Created on 2013-11-01.00:00:00 last changed 131 months ago
Proposed resolution:
This wording is relative to N3797.
Edit [intseq.intseq] as indicated:
namespace std { template<class T, T... I> struct integer_sequence { typedef T value_type; typedef integer_sequence<T, I...> type; static constexpr size_t size() noexcept { return sizeof...(I); } }; }
[ 2014-02-13 Issaquah: Close as NAD ]
AJM: My own implementation used a different alias for types representing parameter packs, and specifically did not define type. I tried it both ways, and found bugs more quickly when type was not defined.
[meta.help] says that integral_constant<T, v> provides ::value_type (for T) and ::type (for itself).
[intseq.intseq] says that integer_sequence<T, I...> provides ::value_type (for T), but nothing for itself. Self-typedefs can be useful when users create chains of derived classes, then want to get the Standard base type. This is especially relevant to integer_sequence, as variadic templates encourage recursive inheritance.History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-14 07:07:05 | admin | set | messages: + msg6857 |
2014-02-14 07:07:05 | admin | set | status: new -> nad |
2014-01-12 13:15:54 | admin | set | messages: + msg6776 |
2013-11-01 00:00:00 | admin | create |