Sunday, October 30, 2011

selector is not an empty class


In paragraph 3.1.2 a selector is defined as an empty class, and later in 3.1.3 we observe that a selector is equivalent to a static_value<bool>, which in fact has a (static) member called value.
However, from that point on, selectors are used as if they contain:

static const bool value = ...; 

The first place where this is actually needed is in section 4.3.1 (otherwise static_OR would not contain a result).
You can replace the definition of selector so that it indeed derives from static_value, or just add the boolean:

template <bool B>
struct selector : static_value<bool, B>
{
};

No comments:

Post a Comment