
3 Apr
2007
3 Apr
'07
11:27 a.m.
abir basak skrev:
Hi, I am inheriting a vector for some reason. Just like template<typename T> class my_vector : public std::vector<T>{ }; I want my_vector to take the advantage of boost::assign library. How to do it?
From http://www.boost.org/libs/assign/doc/index.html#list_of_ref it says: // // Convert to a 'Container'. 'Container' must have a constructor // which takes two iterators. // template< class Container > operator Container() const; so it should simply work out of the box: my_vector<T> foo; foo += 1,2,3,43; my_vector<T> foo = list_of(1)(2)(3); -Thorsten