> Hi,
>
>
>
>
>
> A boost::bind statement in my code generated the following compilation error:
>
>
>
>
>
> 1>Compiling...
>
>
> 1>CmsPayOffReplication.cpp
>
>
> 1>.\CmsPayOffReplication.cpp(79) : error C2665: 'boost::bind' : none of the 2 overloads could convert all the argument types
>
>
> 1> C:\DiskE\OpenSource\boost_1_45_0\boost/bind/bind.hpp(1420): could be 'boost::_bi::bind_t boost::bindarg,QuantLib::Date,QuantLib::Period,QuantLib::Period,QuantLib::Rate>(boost::type,F,A1,A2,A3,A4,A5)'
>
>
> 1> with
>
>
> 1> [
>
>
> 1> R=double,
>
>
> 1> F=QuantLibInterface::YieldCurveUtility *,
>
>
> 1> L=boost::_bi::list5arg,boost::_bi::valueQuantLib::Date>,boost::_bi::value,boost::_bi::value,boost::_bi::valueRate>>,
>
>
> 1> T=QuantLibInterface::YieldCurveUtility,
>
>
> 1> I=1,
>
>
> 1> A1=boost::arg,
>
>
> 1> A2=QuantLib::Date,
>
>
> 1> A3=QuantLib::Period,
>
>
> 1> A4=QuantLib::Period,
>
>
> 1> A5=QuantLib::Rate
>
>
> 1> ]
>
>
> 1> C:\DiskE\OpenSource\boost_1_45_0\boost/bind/bind.hpp(1512): or 'boost::_bi::bind_t boost::bindarg,QuantLib::Date,QuantLib::Period,QuantLib::Period,QuantLib::Rate>(F,A1,A2,A3,A4,A5,A6)'
>
>
> 1> with
>
>
> 1> [
>
>
> 1> R=boost::_bi::unspecified,
>
>
> 1> F=double,
>
>
> 1> L=boost::_bi::list6bi::valueYieldCurveUtility *>,boost::arg,boost::_bi::value,boost::_bi::value,boost::_bi::valuePeriod>,boost::_bi::valueQuantLib::Rate>>,
>
>
> 1> T=QuantLibInterface::YieldCurveUtility,
>
>
> 1> I=1,
>
>
> 1> A1=QuantLibInterface::YieldCurveUtility *,
>
>
> 1> A2=boost::arg,
>
>
> 1> A3=QuantLib::Date,
>
>
> 1> A4=QuantLib::Period,
>
>
> 1> A5=QuantLib::Period,
>
>
> 1> A6=QuantLib::Rate
>
>
> 1> ]
>
>
> 1> while trying to match the argument list '(overloaded-function, QuantLibInterface::YieldCurveUtility *, boost::arg, const QuantLib::Date, const QuantLib::Period, const QuantLib::Period, QuantLib::Rate)'
>
>
> 1> with
>
>
> 1> [
>
>
> 1> I=1
>
>
> 1> ]
>
>
>
>
>
> I replicated the set up of the objects in simpler project, and the bind statement compiled successfully. Can anyone shred some light on the cause of the error?
>
>
>
>
>
> Here is how I call boost::bind
>
>
>
>
>
> QuantLib::Date date;
>
>
> QuantLib::Period p1,p2;
>
>
> QuantLib::Rate rate;
>
>
>
>
>
> // initialization of date, p1, p2, rate
>
>
>
>
>
> boost::functionYieldTermStructure>) >
>
>
> priceWithCurve = boost::bind(
>
>
> &YieldCurveUtility::priceSwap,
>
>
> &YieldCurveUtility::instance(), _1,
>
>
> date, period1, period2, rate );
>
>
>
>
>
> Thank you.