Why does this function give me an error:
template < typename T >
T foo( T s = 0, const vector < T > &v)
{
...
}
error: default argument missing for parameter 2 of ‘template summable sum(summable, const std::vector&)’
And why doesn't the following?:
template < typename T >
T foo( const vector < T > &v, T s = 0)
{
...
}