Skip to content

Instantly share code, notes, and snippets.

@kernhanda
Last active October 1, 2017 01:18
Show Gist options
  • Save kernhanda/ba71da92cac8fe31df3b33cd331b6fec to your computer and use it in GitHub Desktop.
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
// 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