[Bug c++/57684] [c++11] Lambda is not convertible to std::function

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jun 23 12:05:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57684

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think the problem is that unordered_map requires its template arguments to be
complete at the time of instantiation, otherwise it's undefined behaviour.

When the static member is instantiated the type Derived is not complete,
because base<derived> is instantiated before the body of derived.

So although it would be nice if this worked, I think it technically relies on
undefined behaviour.



More information about the Gcc-bugs mailing list