Boost logo

Boost Users :

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

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

> On Wed, 28 Mar 2012, Robert Jones wrote:
> 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
>> 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
>> 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.
> The internals of BOOST_CONCEPT_REQUIRES take the type that you give as the
> return type and use it as a function parameter type (that is why you need
> the parentheses around the outside). That is where those rules in the
> standard get involved.
Ah, thank you, clears it up nicely. I can sleep peacefully!

- Rob.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at