Skip to content

Commit bbb2057

Browse files
authored
[forward] Add \tcode for literals
1 parent de8b220 commit bbb2057

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/utilities.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,19 +376,19 @@
376376
};
377377

378378
void g() {
379-
shared_ptr<A> sp1 = factory<A>(2, 1.414); // error: 2 will not bind to \tcode{int\&}
379+
shared_ptr<A> sp1 = factory<A>(2, 1.414); // error: \tcode{2} will not bind to \tcode{int\&}
380380
int i = 2;
381381
shared_ptr<A> sp2 = factory<A>(i, 1.414); // OK
382382
}
383383
\end{codeblock}
384384
In the first call to \tcode{factory},
385-
\tcode{A1} is deduced as \tcode{int}, so 2 is forwarded
385+
\tcode{A1} is deduced as \tcode{int}, so \tcode{2} is forwarded
386386
to \tcode{A}'s constructor as an rvalue.
387387
In the second call to \tcode{factory},
388388
\tcode{A1} is deduced as \tcode{int\&}, so \tcode{i} is forwarded
389389
to \tcode{A}'s constructor as an lvalue. In
390390
both cases, \tcode{A2} is deduced as \tcode{double}, so
391-
1.414 is forwarded to \tcode{A}'s constructor as an rvalue.
391+
\tcode{1.414} is forwarded to \tcode{A}'s constructor as an rvalue.
392392
\end{example}
393393
\end{itemdescr}
394394

0 commit comments

Comments
 (0)