Error declaring default argument to friend function
I'm stumped. This only gives me an error if the class is a template and the functions are declared within the class. Here's a stripped-down example:
Code:
template < typename T >
struct foo
{
friend void bar( foo< T > const& data, bool condition = false )
{ }
friend void qux( foo< T > const& data )
{
bar( data );
}
};
int main( void )
{
qux( foo< int >( ) );
return 0;
}
The error doesn't make much sense either:
"default argument given for parameter 2 of `void bar(const foo<int>&, bool)' after previous specification in `void bar(const foo<int>&, bool)'.
Any ideas?