While looking at the GCC 4.9.0 release changes here, I was pleasantly surprised to read the following; under the "New Languages and Language specific improvements" section for C++:
G++ supports unconstrained generic functions as specified by §4.1.2 and §5.1.1 of N3889: Concepts Lite Specification. Briefly, auto may be used as a type-specifier in a parameter declaration of any function declarator in order to introduce an implicit function template parameter, akin to generic lambdas.
// the following two function declarations are equivalent
auto incr(auto x) { return x++; }
template <typename T>
auto incr(T x) { return x++; }
I built GCC 4.9.0 and my initial tests worked as expected. I believe that Concepts Lite will remain somehow auxiliary to the upcoming C++14 specification. Is there though any plan for "unconstrained generic functions" to become a part of C++?