Skip to content

Commit 17f76d0

Browse files
authored
Update CppCoreGuidelines.md
1 parent 05c44d2 commit 17f76d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CppCoreGuidelines.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16243,7 +16243,7 @@ and should be used only as building blocks for meaningful concepts, rather than
1624316243
template<typename T>
1624416244
concept Addable = has_plus<T>; // bad; insufficient
1624516245

16246-
template<Addable N> auto plus(const N& a, const N& b) // use two numbers
16246+
template<Addable N> auto algo(const N& a, const N& b) // use two numbers
1624716247
{
1624816248
// ...
1624916249
return a + b;
@@ -16273,19 +16273,19 @@ The ability to specify a meaningful semantics is a defining characteristic of a
1627316273
&& has_multiply<T>
1627416274
&& has_divide<T>;
1627516275

16276-
template<Number N> auto plus(const N& a, const N& b) // use two numbers
16276+
template<Number N> auto algo(const N& a, const N& b) // use two numbers
1627716277
{
1627816278
// ...
1627916279
return a + b;
1628016280
}
1628116281

1628216282
int x = 7;
1628316283
int y = 9;
16284-
auto z = plus(x, y); // z = 18
16284+
auto z = algo(x, y); // z = 18
1628516285

1628616286
string xx = "7";
1628716287
string yy = "9";
16288-
auto zz = plus(xx, yy); // error: string is not a Number
16288+
auto zz = algo(xx, yy); // error: string is not a Number
1628916289

1629016290
##### Note
1629116291

0 commit comments

Comments
 (0)