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: Prefer template arguments to be movable and default-constructible](#rt-regular)
17077
+
* [T.46: (removed)](#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,39 +18110,8 @@ 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: Prefer template arguments to be movable and default-constructible
18113
+
### <a name="rt-regular"></a>T.46: (removed)
18114
18114
18115
-
##### Reason
18116
-
18117
-
Readability.
18118
-
Preventing surprises and errors.
18119
-
Most uses support that anyway.
18120
-
18121
-
##### Example
18122
-
18123
-
// X is not default constructible
18124
-
class X {
18125
-
public:
18126
-
explicit X(int);
18127
-
X(const X&); // copy
18128
-
X operator=(const X&);
18129
-
X(X&&) noexcept; // move
18130
-
X& operator=(X&&) noexcept;
18131
-
~X();
18132
-
// ... no more constructors ...
18133
-
};
18134
-
18135
-
X x {1}; // fine
18136
-
X y = x; // fine
18137
-
std::vector<X> v(10); // error: no default constructor
18138
-
18139
-
##### Exceptions
18140
-
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.
18142
-
18143
-
##### Enforcement
18144
-
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.
18146
18115
18147
18116
### <a name="rt-visible"></a>T.47: Avoid highly visible unconstrained templates with common names
0 commit comments