Skip to content

Commit ebd2b05

Browse files
committed
Update to just remove T.46
1 parent 6454e44 commit ebd2b05

1 file changed

Lines changed: 2 additions & 33 deletions

File tree

CppCoreGuidelines.md

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17074,7 +17074,7 @@ Template interface rule summary:
1707417074
* [T.42: Use template aliases to simplify notation and hide implementation details](#rt-alias)
1707517075
* [T.43: Prefer `using` over `typedef` for defining aliases](#rt-using)
1707617076
* [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)
1707817078
* [T.47: Avoid highly visible unconstrained templates with common names](#rt-visible)
1707917079
* [T.48: If your compiler does not support concepts, fake them with `enable_if`](#rt-concept-def)
1708017080
* [T.49: Where possible, avoid type-erasure](#rt-erasure)
@@ -18110,39 +18110,8 @@ For example:
1811018110

1811118111
Flag uses where an explicitly specialized type exactly matches the types of the arguments used.
1811218112

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)
1811418114

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.
1814618115

1814718116
### <a name="rt-visible"></a>T.47: Avoid highly visible unconstrained templates with common names
1814818117

0 commit comments

Comments
 (0)