This code runs on Visual Studio 2013 but not on gcc 4.9.2:
template <typename T>
void foo(){
T::value_type bar('a');
cout << bar << endl;
}
int main() {
foo<string>();
return 0;
}
It seems that Visual Studio 2013 deduces type to allow me to implement types defined in template arguments whereas gcc 4.9.2 does not.
Is there a workaround for this that would allow this behavior in gcc?