Subject: Re: [boost] [type trait extension] I hate volatile...
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2011-07-17 15:38:32
> What does your code look like that detects void types? I use the following
> EXPR_IS_VOID macro myself (which is not originally mine, but I think I have
> modified it from the original after some testing); feel free to pilfer. The
> double comma operator thingy is intended to work even if the type of ( Expr
> ) has an overloaded comma operator, but I've found that GCC has issues with
> this construct, hence the two versions.
> #define EXPR_IS_VOID( Expr ) \
> EXPR_IS_CONVERTIBLE( \
> ( ( Expr ), ::detail_expr_is_void::void_detector_t() ), \
> ::detail_expr_is_void::void_detector_t \
Interesting: I do not have a series of 2 operator, but instead have
non_void_t operator,(const T&, void_detector_t) declared.
I will check if your implementation gives something better. Thanks a
lot for your contribution.