Title
The type property queries should be UnaryTypeTraits returning size_t
Status
c++14
Section
[meta.unary.prop.query]
Submitter
Stephan T. Lavavej

Created on 2013-09-21.00:00:00 last changed 130 months ago

Messages

Date: 2014-02-13.04:55:14

Proposed resolution:

This wording is relative to N3691.

  1. Following [meta.unary.prop.query]/1 add a new paragraph as indicated:

    Each of these templates shall be a UnaryTypeTrait ([meta.rqmts]) with a BaseCharacteristic of integral_constant<size_t, Value>.

Date: 2014-02-13.04:55:14

[ Issaquah 2014-02-11: Move to Immediate ]

Date: 2013-09-21.00:00:00

The sibling sections [meta.unary], [meta.rel], and [meta.trans] respectively specify UnaryTypeTraits, BinaryTypeTraits, and TransformationTraits, as stated by each /2 paragraph. However, [meta.unary.prop.query] is underspecified. alignment_of, rank, and extent are said to produce "Values", but the type of that Value is not specified, and the struct templates are not required to derive from integral_constant. Such derivation is more than stylistic — it allows the structs to be passed to functions taking integral_constant.

alignment_of returns alignof(T) which is size_t ([expr.alignof]/2). extent returns an array bound, which is clearly size_t. rank returns "the number of dimensions" of an array, so any type could be chosen, with size_t being a reasonable choice. (Another choice would be unsigned int, to match extent's template parameter I.)

History
Date User Action Args
2014-02-27 17:03:20adminsetstatus: wp -> c++14
2014-02-20 13:52:38adminsetstatus: immediate -> wp
2014-02-13 04:55:14adminsetmessages: + msg6827
2014-02-13 04:55:14adminsetstatus: new -> immediate
2013-10-11 18:12:22adminsetmessages: + msg6703
2013-09-21 00:00:00admincreate