Title
Class template integral_constant should be a constrained template
Status
nad concepts
Section
[meta.help]
Submitter
Daniel Krügler

Created on 2009-03-22.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

  1. In [meta.type.synop], Header <type_traits> synopsis change as indicated:

    namespace std {
    // 20.5.3, helper class:
    template <classIntegralConstantExpressionType T, T v> struct integral_constant;
    
  2. In [meta.help] change as indicated:

    template <classIntegralConstantExpressionType T, T v>
    struct integral_constant {
      static constexpr T value = v;
      typedef T value_type;
      typedef integral_constant<T,v> type;
      constexpr operator value_type() { return value; }
    };
    
Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

Move to Open, pending a paper that looks at constraints for the entirety of the type traits and their relationship to the foundation concepts. We recommend this be deferred until after the next Committee Draft is issued.

Date: 2009-03-22.00:00:00

A first step to change the type traits predicates to constrained templates is to constrain their common base template integral_constant. This can be done, without enforcing depending classes to be constrained as well, but not vice versa without brute force late_check usages. The following proposed resolution depends on the resolution of LWG issue 1019.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg681
2010-10-21 18:28:33adminsetmessages: + msg680
2009-03-22 00:00:00admincreate