Boost logo

Boost Users :

From: abir basak (abirbasak_at_[hidden])
Date: 2007-04-03 08:46:12


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_at_[hidden]
homepage: www.abirbasak.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net