H
Hicham Mouline
hello,
I have
template<typename CurveTraits>
class TimeCurve1D
{
public:
typedef typename CurveTraits::tType tType;
typedef typename CurveTraits::fType fType;
fType GetSomething() const;
private:
typedef std:
air<tType,fType>
EntryType;
typedef boost::array< EntryType, mContainerMaxSize > ContainerType;
ContainerType
m;
size_t
mContainerSize;
};
In GetSomething(), I use std::lower_bound( &m[0], &m[mContainerMaxSize],
std:
air<t, NaN> )
lower_bound uses operator< by default
Where can I defined this operator< for EntryType?
and how can I declare it a friend inside TimeCurve1D?
I tried
template<typename CurveTraits>
class TimeCurve1D
{
.....
friend bool operator< <CurveTraits>( const EntryType&, const EntryType&);
.....
};
template<typename CurveTraits>
inline bool operator<( const typename TimeCurve1D<CurveTraits>::EntryType&
lhs,
const typename TimeCurve1D<CurveTraits>::EntryType&
rhs )
{
return lhs.first < rhs.first;
}
On instantiation, it said
typedef struct std:
air<double, double> TimeCurve1D<...>::EntryType' is
private
but I am trying to make operator< friend...
rds,
I have
template<typename CurveTraits>
class TimeCurve1D
{
public:
typedef typename CurveTraits::tType tType;
typedef typename CurveTraits::fType fType;
fType GetSomething() const;
private:
typedef std:
EntryType;
typedef boost::array< EntryType, mContainerMaxSize > ContainerType;
ContainerType
m;
size_t
mContainerSize;
};
In GetSomething(), I use std::lower_bound( &m[0], &m[mContainerMaxSize],
std:
lower_bound uses operator< by default
Where can I defined this operator< for EntryType?
and how can I declare it a friend inside TimeCurve1D?
I tried
template<typename CurveTraits>
class TimeCurve1D
{
.....
friend bool operator< <CurveTraits>( const EntryType&, const EntryType&);
.....
};
template<typename CurveTraits>
inline bool operator<( const typename TimeCurve1D<CurveTraits>::EntryType&
lhs,
const typename TimeCurve1D<CurveTraits>::EntryType&
rhs )
{
return lhs.first < rhs.first;
}
On instantiation, it said
typedef struct std:
private
but I am trying to make operator< friend...
rds,