[cxx-abi-dev] Mangling C++0x Lambdas

David Vandevoorde daveed at edg.com
Wed Dec 17 17:48:38 UTC 2008


On Dec 17, 2008, at 12:05 PM, Doug Gregor wrote:
[...]
> Ah, right. Well, decltype will surely get us into trouble:
>
>  template<typename Lambda> struct Y { };
>
>  Y<decltype([](int x) -> int { return x; })> y;


Having thought about that some more... I think that cannot be matched  
across translation units either.

I.e., every occurrence of a lambda has a different type.  E.g.:

   template<typename Lambda> struct Y { };
   extern Y<decltype([](int x) -> int { return x; })> y;  // Okay,  
but...
   Y<decltype([](int x) -> int { return x; })> y;         // Error:  
not redeclared with the same type.

	Daveed




More information about the cxx-abi-dev mailing list