HI,
i have a class like this (simplified version)
template<typename C>
class range_view{
public: /// all of the container typedefs.
iterator begin(){
return cont_.begin()+range_.first;
}
iterator end(){
return cont_.begin()+range_.second;
}
private:
C* cont_;
std::pait<size_type,size_type> range_;
};
now i want to handle begin & end different way some container. At
present i copied it again written as,
template<typename C, typename M = C::remove_aware>
class range_view{
public: /// all of the container typedefs.
iterator begin(){
return cont_->begin()+range_.first+cont_->remove_count();
}
iterator end(){
return cont_->begin()+range_.second+cont_->remove_count();
}
private:
C* cont_;
std::pait<size_type,size_type> range_;
};
so, instead of having a full class for a remove aware container, i
want just begin & end should match with the trait...
anyways can it be done using SFINAE ?
thanks
abir


|