You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [T.42: Use template aliases to simplify notation and hide implementation details](#rt-alias)
17075
17075
* [T.43: Prefer `using` over `typedef` for defining aliases](#rt-using)
17076
17076
* [T.44: Use function templates to deduce class template argument types (where feasible)](#rt-deduce)
17077
-
* [T.46: Require template arguments to be at least semiregular](#rt-regular)
17077
+
* [T.46: Prefer template arguments to be movable and default-constructible](#rt-regular)
17078
17078
* [T.47: Avoid highly visible unconstrained templates with common names](#rt-visible)
17079
17079
* [T.48: If your compiler does not support concepts, fake them with `enable_if`](#rt-concept-def)
17080
17080
* [T.49: Where possible, avoid type-erasure](#rt-erasure)
@@ -18110,7 +18110,7 @@ For example:
18110
18110
18111
18111
Flag uses where an explicitly specialized type exactly matches the types of the arguments used.
18112
18112
18113
-
### <a name="rt-regular"></a>T.46: Require template arguments to be at least semiregular
18113
+
### <a name="rt-regular"></a>T.46: Prefer template arguments to be movable and default-constructible
18114
18114
18115
18115
##### Reason
18116
18116
@@ -18120,6 +18120,7 @@ Most uses support that anyway.
18120
18120
18121
18121
##### Example
18122
18122
18123
+
// X is not default constructible
18123
18124
class X {
18124
18125
public:
18125
18126
explicit X(int);
@@ -18135,13 +18136,13 @@ Most uses support that anyway.
18135
18136
X y = x; // fine
18136
18137
std::vector<X> v(10); // error: no default constructor
18137
18138
18138
-
##### Note
18139
+
##### Exceptions
18139
18140
18140
-
Semiregular requires default constructible.
18141
+
A trait type is not necessarily movable and default-constructible. Templates that use trait types usually use them with `Trait::something` scope resolution syntax, rather than using objects of the trait type.
18141
18142
18142
18143
##### Enforcement
18143
18144
18144
-
* Flag types used as template arguments that are not at least semiregular.
18145
+
* Flag types used as template arguments that do not satisfy both `std::movable` and `std::default_constructible` and that are using in the template without `::` scope resolution syntax.
18145
18146
18146
18147
### <a name="rt-visible"></a>T.47: Avoid highly visible unconstrained templates with common names
0 commit comments