While leaving it blank is the obvious option, I’d go with
#define conditional_noop(x) do {} while(0)
This trick is obviously no-op, but forces you to write a semicolon after conditional_noop(123)
.
More Related Contents:
- Are C++ Templates just Macros in disguise?
- C++ type registration at compile time trick
- Why can’t the template argument be deduced when it is used as template parameter to another template?
- Two phase lookup – explanation needed
- How to detect whether there is a specific member variable in class?
- Why not infer template parameter from constructor?
- Explicit template instantiation – when is it used?
- Accessing inherited variable from templated parent class [duplicate]
- Determine if a type is an STL container at compile time
- C++ Static member initialization (template fun inside)
- When to use std::forward to forward arguments?
- What does “#pragma comment” mean?
- Template function as a template argument
- What does this variadic template code do?
- C++ static template member, one instance for each template type?
- How to generate random variable names in C++ using macros?
- How do I export templated classes from a dll without explicit specification?
- Why should I avoid macros in C++? [closed]
- How to write `is_complete` template?
- How to make std::make_unique a friend of my class
- Template Function Specialization for Integer Types
- How to tame the Windows headers (useful defines)?
- Compile-time constant id
- Expand macro inside string literal
- Compile-time map and inverse map values
- Specialized template function with deleted “general” case fails to compile with g++
- How can I define a string literal on the GCC command line?
- Why don’t I need to specify “typename” before a dependent type in C++20?
- Template function inside template class
- c++ template class; function with arbitrary container type, how to define it?