Following code gives a compilation error when compiled with g++
Code:
#include <map>
using namespace std;
class G
{
//void fun(int , const std::map<std::string, bool> & some_attributes = std::map<std::string, bool>());
void fun(int , const map<string, bool>& some_attributes = std::map<std::string, bool>());
};
Error is
======
test.cxx:7: error: expected `,' or `...' before '>' token
test.cxx:7: error: wrong number of template arguments (1, should be 4)
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h:92: error: provided for `template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
test.cxx:7: error: default argument missing for parameter 3 of `void G::fun(int, const std::map<std::string, bool, std::less<std::string>, std::allocator<std:air<const std::string, bool> > >&, bool)'
=======
Any one has any idea how to get rid of the error ?