This builds fine as a parameter to a function declaration on x64 VS100 (MSVC++ 2010) but fails on RHEL5 (gcc 4.1.2):
const std::vector<std::pair<std::string, std::string> >& = std::vector<std::pair<std::string, std::string> >()
The whole function since some have asked is (with said parameter being the 3rd):
bool func(const std::string&, const std::vector<int>&, const std::vector<std::pair<std::string, std::string> >& =
std::vector<std::pair<std::string, std::string> >(), const std::vector<std::string>& = std::vector<std::string>(),
const std::vector<std::string>& = std::vector<std::string>(), const std::vector<double>& = std::vector<double>(),
const std::vector<double>& = std::vector<double>(), const std::vector<double>& = std::vector<double>(),
const std::vector<double>& = std::vector<double>(), const std::vector<double>& = std::vector<double>(),
const std::string& = "", const std::string& = "", const std::string& = "") const;
The error I got on RHEL5 gcc-4.1.2 is:
line #: error: expected ',' or '...' before '>' token
line #: error: wrong number of template arguments (1, should be 2)
line #: error: template argument 1 is invalid
line #: error: template argument 2 is invalid
Note that this compiles fine on both platforms with 3rd parameter replaced by:
std::vector<std::string>& = std::vector<std::string>()
My current workaround is to use the latter form and change my implementation a bit to account for it, and this does the job currently. But any ideas why the original usage is failing to build on RHEL5 gcc-4.1.2 and what would be correct usage is very appreciated. Thank you.