2010-01-06から1日間の記事一覧
C++のデフォルト引数で、ちょっと変なことができることに気がついた。 ostream & f(int,ostream &){ return cout <<"f"; } template<typename anytype> ostream & f(anytype){ return cout << "t"; } void test() { f(0) << "\n"; // t ostream & f( int,ostream & = f(0) ); f</typename>…