Casting a variadic parameter pack to (void)
When working with variadic template, it is more clean to use sink:
struct sink { template<typename ...Args> sink(Args const & ... ) {} };
#ifdef DEBUG
std::cout << value;
bar(std::forward<Args>(args)...);
#else
sink { value, args ... }; //eat all unused arguments!
#endif
You could really go with conditional naming here.
#ifdef DEBUG
#define DEBUG_NAME(x) x
#else
#define DEBUG_NAME(x)
#endif
static void bar(T&& DEBUG_NAME(value), Args&& DEBUG_NAME(args)) {}