Created on 2009-03-19.00:00:00 last changed 162 months ago
Proposed resolution:
In [func.bind.isbind] change as indicated:
namespace std { template<class T> struct is_bind_expression : integral_constant<bool, see below> { };{ static const bool value = see below; };}
In [func.bind.isbind]/2 change as indicated:
static const bool value;-2-
true if T is a type returned from bind, false otherwise.If T is a type returned from bind, is_bind_expression<T> shall be publicly derived from integral_constant<bool, true>, otherwise it shall be publicly derived from integral_constant<bool, false>.
In [func.bind.isplace] change as indicated:
namespace std { template<class T> struct is_placeholder : integral_constant<int, see below> { };{ static const int value = see below; };}
In [func.bind.isplace]/2 change as indicated:
static const int value;-2-
value is J if T is the type of std::placeholders::_J, 0 otherwise.If T is the type of std::placeholders::_J, is_placeholder<T> shall be publicly derived from integral_constant<int, J> otherwise it shall be publicly derived from integral_constant<int, 0>.
[ 2009-10 post-Santa Cruz: ]
Move to Tentatively Ready. We are comfortable with requiring user specializations to derive from integral_constant.
[ 2009-05-31 Peter adds: ]
I am opposed to the proposed resolution and to the premise of the issue in general. The traits's default definitions should NOT derive from integral_constant, because this is harmful, as it misleads people into thinking that is_bind_expression<E> always derives from integral_constant, whereas it may not.
is_bind_expression and is_placeholder allow user specializations, and in fact, this is their primary purpose. Such user specializations may not derive from integral_constant, and the places where is_bind_expression and is_placeholder are used intentionally do not require such derivation.
The long-term approach here is to switch to BindExpression<E> and Placeholder<P> explicit concepts, of course, but until that happens, I say leave them alone.
[ Batavia (2009-05): ]
We recommend this be deferred until after the next Committee Draft is issued.
Move to Open.
[ 2009-03-22 Daniel provided wording. ]
[ Daniel adds: ]
We need the same thing for the trait is_placeholder as well.
Class template is_bind_expression [func.bind.isbind]:
namespace std { template<class T> struct is_bind_expression { static const bool value = see below; }; }
is_bind_expression should derive from std::integral_constant<bool> like other similar trait types.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg587 |
2010-10-21 18:28:33 | admin | set | messages: + msg586 |
2010-10-21 18:28:33 | admin | set | messages: + msg585 |
2010-10-21 18:28:33 | admin | set | messages: + msg584 |
2010-10-21 18:28:33 | admin | set | messages: + msg583 |
2010-10-21 18:28:33 | admin | set | messages: + msg582 |
2009-03-19 00:00:00 | admin | create |