
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: 09 April 2009 15:40 To: boost-users@lists.boost.org Subject: Re: [Boost-users] default argument and call trait const_reference
AMDG
Hicham Mouline wrote:
template<typename C> class X { public:
template
void Get (int, typename boost::call_traits<Interp>::const_reference= Interp(), typename boost::call_traits<Extrap>::const_reference= Extrap() ) const; }; <snip>
class P { public: static const size_t defaultInterpolationOrder = 2; // quadratic polynomial
Polynomial1D(size_t order =defaultInterpolationOrder) : mOrder(order) {}
This is not legal. The name of the constructor should be the same as the name of the class.
Private:
Should be private? How this code even compiles is beyond me.
size_t mOrder; };
1 example of call is
x.template GetSpot
( 5 );
GetSpot? I only see Get.
I apologize, I didn't replace all names to make code more readable... It was just P ... that was P's ctor... It's Get, not GetSpot x.template Get
( 5 ); I've added to default argument to the out-of-class definition as well and then it works... does it make any sense? H