#include <stdint.h>
template <int D, typename T=double>
struct A{
template <typename T2=T> T2 prod() const { return T2(); }
};
template <typename T, int D>
struct C{
A<D, int> box;
double f(){ return box.prod<double>(); }
};
tmp$ g++ -std=c++11 -Wall -c test2.cpp
test2.cpp: In member function ‘double C<T, D>::f()’:
test2.cpp:11:30: error: expected primary-expression before ‘double’
double f(){ return box.prod<double>(); }
^
test2.cpp:11:30: error: expected ‘;’ before ‘double’
test2.cpp:11:36: error: expected unqualified-id before ‘>’ token
double f(){ return box.prod<double>(); }
^
tmp$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
...
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10)
Ы?