I’ve run into a limitation using boost exception and make_tuple with zero arguments. Essentially I have a macro like this:
#define MAKE_EXCEPT( msg, ... ) exception( msg ) << make_tuple(__VAR_ARGS__)
Where the variables arguments will be various error_info types. The above is simplified from the full macro, I’ve just pulled out the bit causing me trouble.
The problem is that if there are no arguments I get an error above no operator<< defined for the involved types. That is, although make_tuple() is well defined (I even used it elsewhere) the overload with exception doesn’t work here.
I’m looking now to make a workaround. So instead of using the operator directly I wrap it in a function:
#define MAKE_EXCEPT( msg, ... ) make_except( exception( msg ), make_tuple(__VAR_ARGS__) )
Now, the question is how do I specialize this function? I need a version that works with the normal tuples and one with the null_tuple.
I’ve found something that works. This seems overly complicated. Perhaps somebody else has a better/simpler solution.
In this code
make_exceptis callederror_with_tags