In this answer I point out that I can define a templatized method within a struct defined in a lambda. gcc gives a compiler error when I try to do this.
To the end of a Minimal, Complete, Verifiable Example I've writen a simpler example case here:
[]{struct{
template <typename T> foo() { cout << "default\n"; }
template <> foo<char> foo() { cout << "specialized\n"; } } result;
return result; }
This code runs fine in Visual Studio which can be tested at http://webcompiler.cloudapp.net/ but the linked gcc code:
Invalid declaration of member template in local class