arlo on 17 May 2003 03:24:01 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [ALACPP] Chris' stupid C++ trick of the week


> template<typename T>
> T& doFoo(T& aTarget) {
>     //do something with aTarget
>     return aTarget;
> }

Actually, upon looking at this code a bit more, I found a more problematic
error. What if the template is specialized with int&?

The reference to reference problem is actually the one that the boost lib
is trying to solve. However, the same mechanism (or one layering on top if
it) can also solve the problem that you asked about.

Arlo



_______________________________________________
alacpp mailing list
alacpp@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/alacpp