Compiler bug in Market Models???
Posted by Joseph Wang-2 on Jul 09, 2006; 5:45am
URL: http://quantlib.414.s1.nabble.com/Compiler-bug-in-Market-Models-tp4910.html
Need a language lawyer :-) :-) :-)
g++ 4.0 on Linux is choking on
EvolutionDescription(
const Array& rateTimes,
const Array& evolutionTimes,
const std::vector<Size>& numeraires = std::vector<Size>(),
const std::vector<std::pair<Size,Size> > &relevanceRates =
std::vector<std::pair<Size,Size> > ());
with
../../ql/MarketModels/evolutiondescription.hpp:62: error: expected ‘,’
or ‘...’ before ‘>’ token
../../ql/MarketModels/evolutiondescription.hpp:62: error: wrong number of
template arguments (1, should be 2)
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/../../../../include/c++/4.1.1/bits/stl_pair.h:68:
error: provided for ‘template<class _T1, class _T2> struct std::pair’
../../ql/MarketModels/evolutiondescription.hpp:62: error: template argument 1
is invalid
../../ql/MarketModels/evolutiondescription.hpp:62: error: template argument 2
is invalid
../../ql/MarketModels/evolutiondescription.hpp:62: error: default argument
missing for parameter 5
of ‘QuantLib::EvolutionDescription::EvolutionDescription(const
QuantLib::Array&, const QuantLib::Array&, const std::vector<unsigned int,
std::allocator<unsigned int> >&, const std::vector<std::pair<unsigned int,
unsigned int>, std::allocator<std::pair<unsigned int, unsigned int> > >&,
QuantLib::Size)’
But it works if I typedef the template
typedef std::vector<std::pair<Size,Size> > RelevanceRatesType;
EvolutionDescription(
const Array& rateTimes,
const Array& evolutionTimes,
const std::vector<Size>& numeraires = std::vector<Size>(),
const std::vector<std::pair<Size,Size> > &relevanceRates =
RelevanceRatesType ());
is G++ broken?