File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 376376};
377377
378378void 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 }
384384In 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
386386to \tcode {A}'s constructor as an rvalue.
387387In the second call to \tcode {factory},
388388\tcode {A1} is deduced as \tcode {int\& }, so \tcode {i} is forwarded
389389to \tcode {A}'s constructor as an lvalue. In
390390both 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
You can’t perform that action at this time.
0 commit comments