Skip to content
Snippets Groups Projects
Commit 452f32da authored by Axel Naumann's avatar Axel Naumann
Browse files

Second try to fix the ugly cast of iter<A> to iter<B>. Just hard cast the container...

git-svn-id: http://root.cern.ch/svn/root/trunk@22789 27541ba8-7e3a-0410-8455-c3a389f83636
parent 4d817fdf
No related merge requests found
......@@ -25,26 +25,22 @@ namespace Reflex {
template < typename CONT >
static typename std::vector<TO>::iterator Begin( const CONT & cont ) {
if ( ! cont.size()) return End<CONT>(cont);
else return typename std::vector<TO>::iterator((TO*)&cont[0]);
return ((typename std::vector<TO> &)const_cast<CONT &>(cont)).begin();
}
template < typename CONT >
static typename std::vector<TO>::iterator End( const CONT & cont ) {
typename std::vector<TO>::iterator it = typename std::vector<TO>::iterator((TO*)&cont[cont.size()-1]);
return it++;
return ((typename std::vector<TO> &)const_cast<CONT &>(cont)).end();
}
template < typename CONT >
static typename std::vector<TO>::const_reverse_iterator RBegin( const CONT & cont ) {
if ( ! cont.size()) return REnd<CONT>(cont);
else return typename std::vector<TO>::const_reverse_iterator(typename std::vector<TO>::iterator((TO*)&cont[cont.size()-1]));
return ((typename std::vector<TO> &)cont).rbegin();
}
template < typename CONT >
static typename std::vector<TO>::const_reverse_iterator REnd( const CONT & cont ) {
typename std::vector<TO>::iterator it = typename std::vector<TO>::iterator((TO*)&cont[0]);
return typename std::vector<TO>::const_reverse_iterator(it--);
return ((typename std::vector<TO> &)cont).rend();
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment