Boost logo

Boost Users :

Subject: Re: [Boost-users] [Concepts & EnableIf] Is void special?
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2012-03-28 12:22:21


On Wed, Mar 28, 2012 at 4:24 PM, Jeremiah Willcock <jewillco_at_[hidden]>wrote:

>
> It looks like the trick is to put the enable_if outside the
> BOOST_CONCEPT_REQUIRES, as in:
>
> template <typename T>
> typename enable_if<
> condition,
> BOOST_CONCEPT_REQUIRES(**concept, (void))>::type
>
> Paragraph 4 of [dcl.fct] (in the latest draft) seems to say that the
> SFINAE error you are getting is required: only the specific type void,
> written in a non-dependent way, counts as a valid function parameter type.
>
>
Well, I can't deny that it works! Seems to be reading quite a bit into the
standard tho', assuming you're looking at

 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf

If I'm reading it right it is actually talking about function parameter
lists, rather than function return types, and stating that
void is not a valid parameter type except for f(void) to indicate an empty
parameter list.

Thx, Rob.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net