
Eric Niebler wrote:
Frédéric Bron wrote:
I would like to detect if the return type of a function is void or not within C++03 standard? <snip>
I solved this problem once while writing a different trait and documented it here:
http://www.boost.org/doc/libs/1_41_0/doc/html/proto/appendices.html#boost_pr...
I gotta admit, this thing is amazing. I actually needed to implement a way to tell whether a type is an io manipulator (basically telling if calling T(ostream) is a well-formed expression), and was at a loss. I was about to post a question on comp.lang.c++ but suddenly came across this thread and your solution fit like hand in glove. I do have a question though. In your "fununwrap2" class you define the typedef as typedef private_type const &(*pointer_to_function) (dont_care, dont_care); and dont_care constructor has ellipsis instead of an argument list. Why use dont_care at all? Why not define the pointer_to_function type as: typedef private_type (*pointer_to_function) (...); It seems to be working just as good. Or am I missing something? Thanks, Andy.