Skip to content

Commit 4867a5c

Browse files
xtoflKristoffel Pirard
andauthored
Use '<thing> template' i.s.o. 'template <thing>' (isocpp#1631)
* Use '<thing> template' i.s.o. 'template <thing>' The word 'template' is often wrongly used as an adjective to the 'thing' it becomes when instantiated. * Expand succinct formulation for readability Co-authored-by: Kristoffel Pirard <kristoffel.pirard@vanhool.com>
1 parent 1936cb6 commit 4867a5c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

CppCoreGuidelines.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ What if the connection goes down so that no logging output is produced? See I.??
12771277
Note that non-`const` member functions pass information to other member functions through their object's state.
12781278

12791279
**Alternative formulation**: An interface should be a function or a set of functions.
1280-
Functions can be template functions and sets of functions can be classes or class templates.
1280+
Functions can be function templates and sets of functions can be classes or class templates.
12811281

12821282
##### Enforcement
12831283

@@ -2663,7 +2663,7 @@ Member functions defined in-class are `inline` by default.
26632663

26642664
##### Exception
26652665

2666-
Template functions (incl. template member functions) are normally defined in headers and therefore inline.
2666+
Function templates (including member functions of class templates `A<T>::function()` and member function templates `A::function<T>()`) are normally defined in headers and therefore inline.
26672667

26682668
##### Enforcement
26692669

@@ -4124,7 +4124,7 @@ For example, we can now change the representation of a `Date` without affecting
41244124
##### Note
41254125

41264126
Using a class in this way to represent the distinction between interface and implementation is of course not the only way.
4127-
For example, we can use a set of declarations of freestanding functions in a namespace, an abstract base class, or a template function with concepts to represent an interface.
4127+
For example, we can use a set of declarations of freestanding functions in a namespace, an abstract base class, or a function template with concepts to represent an interface.
41284128
The most important issue is to explicitly distinguish between an interface and its implementation "details."
41294129
Ideally, and typically, an interface is far more stable than its implementation(s).
41304130

@@ -8079,7 +8079,7 @@ See [C.146](#Rh-dynamic_cast) and ???
80798079

80808080
## <a name="SS-overload"></a>C.over: Overloading and overloaded operators
80818081

8082-
You can overload ordinary functions, template functions, and operators.
8082+
You can overload ordinary functions, function templates, and operators.
80838083
You cannot overload function objects.
80848084

80858085
Overload rule summary:
@@ -10335,7 +10335,7 @@ Flag variable and constant declarations with multiple declarators (e.g., `int* p
1033510335

1033610336
* Simple repetition is tedious and error-prone.
1033710337
* When you use `auto`, the name of the declared entity is in a fixed position in the declaration, increasing readability.
10338-
* In a template function declaration the return type can be a member type.
10338+
* In a function template declaration the return type can be a member type.
1033910339

1034010340
##### Example
1034110341

@@ -17943,7 +17943,7 @@ Some people found the idea that the `Link` no longer was hidden inside the list
1794317943
##### Note
1794417944

1794517945
A more general version of this rule would be
17946-
"If a template class member depends on only N template parameters out of M, place it in a base class with only N parameters."
17946+
"If a class template member depends on only N template parameters out of M, place it in a base class with only N parameters."
1794717947
For N == 1, we have a choice of a base class of a class in the surrounding scope as in [T.61](#Rt-scary).
1794817948

1794917949
??? What about constants? class statics?

0 commit comments

Comments
 (0)