
Thorsten Ottosen wrote:
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 Thanks. I had removed that constructor from my actual implementation (which has a private inheritance ) :( Now it works .
Thanks again. abir -- Abir Basak, Member IEEE Software Engineer, Read Ink Technologies B. Tech, IIT Kharagpur email: abir@abirbasak.com homepage: www.abirbasak.com