Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
75 views

Pass undefined number of template classes (having commas) as macro argument

TL;DR What are the available tricks to pass undefined number of template classes to a macro in C++17 ? Example: my_macro(std::map<std::string,std::vector<double>>, double, std::deque<...
Caduchon's user avatar
  • 5,171
4 votes
2 answers
1k views

Counting function arguments at compile time

I'm trying to count the number of arguments to a function at compile time (I'm wrapping sprintf up in some templates for compile time checks and type safety). I need to check that the number of ...
Adam's user avatar
  • 1,203
3 votes
2 answers
177 views

Testing member function, by peeling pairs off variadic macro/template/function?

(I'm using catch for unit testing, which unfortunately doesn't yet have what it's calling generators to do this sort of thing.) In c++17, is there a way to reduce this: assert("" == String{"" }....
user1902689's user avatar
  • 1,775