[ create a new paste ] login | about

Link: http://codepad.org/zy3WFbe7    [ raw code | output | fork ]

C++, pasted on Sep 15:
template<typename CurveTraits>
class Curve1D
{
public:
  typedef typename CurveTraits::xType xType;
  typedef typename CurveTraits::fType fType;

  template<typename Interp, typename Extrap>
  fType Get(xType abscissa, 
            typename boost::call_traits<Interp>::param_type i =Interp(),
            typename boost::call_traits<Extrap>::param_type e =Extrap() ) const;
};

template<typename CurveTraits>
template<typename Interp, typename Extrap>
typename CurveTraits::fType
Curve1D<CurveTraits>::Get(xType x, 
                    typename boost::call_traits<Interp>::param_type i,
                    typename boost::call_traits<Extrap>::param_type e ) const
{
  // when debugger reaches here, e is not constructed properly
}

class Linear1D {
public:    
    /// Constructor
    Linear1D(double fPrimebegin=NaN, double fPrimeend=NaN, double fboundary=NaN)
        : mfPrimebegin(fPrimebegin), mfPrimeend(fPrimeend), mfboundary(fboundary)
    {}
private:
  double mfPrimebegin;
  double mfPrimeend;
  double mfboundary;
};


Output:
1
2
Line 27: error: 'NaN' was not declared in this scope
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: