Last active
October 1, 2017 01:18
-
-
Save kernhanda/ba71da92cac8fe31df3b33cd331b6fec to your computer and use it in GitHub Desktop.
Use to suppress unused parameters and variables in a cross-platform manner without macros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use to suppress unused parameters and variables in a cross-platform manner without macros | |
#pragma once | |
#include <utility> | |
template <typename T1> | |
constexpr void unused_args(T1&& t1) | |
{ | |
(void)t1; | |
} | |
template <typename T1, typename... Args> | |
constexpr void unused_args(T1&& t1, Args&&... args) | |
{ | |
(void)t1; | |
unused_args(std::forward<Args>(args)...); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment