Hi, the following code, which tries to specialize on template function overloading fails to compile: -------------------------------------------------------------------------------------------------------- #include <iostream> #include <vector> template< typename T_VECTOR > void f(const T_VECTOR &a, decltype(a[0]) t = 0) { std::cout << "has operator[] \n"; } template< typename T > void f(const T &a, decltype(a+1) t = 0) { std::cout << "has operator+(int)\n"; } int main() { std::vector< int > a; int c; f(a); f(c); } ----------------------------------------------------------------------------------------------------- compiled with g++-4.5 -std=c++0x code.cpp it gives: code.cpp: In function ‘int main()’: code.cpp:19:8: error: subscripted value is neither array nor pointer To my understanding, it should compile fine, since f(c) should resolve to the second overload of f(). Is this a bug in g++-4.5? Thanks for any hints, Onay Urfalioglu