Boost logo

Boost Users :

Subject: Re: [Boost-users] default argument and call trait const_reference
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-04-09 10:39:51


AMDG

Hicham Mouline wrote:
> template<typename C>
> class X
> {
> public:
>
> template<typename Interp, typename Extrap>
> 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<P,P>( 5 );
>

GetSpot? I only see Get.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net