Boost logo

Boost Users :

Subject: [Boost-users] Is there a self contained vector-like container?
From: Frank Birbacher (bloodymir.crap_at_[hidden])
Date: 2012-03-01 15:13:27


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Is there in Boost a container that is statically "max sized" and
contains its own storage like a std::array, but manages a size and can
construct and destruct elements. I guess it would look something like:

template<typedef T, size_t N>
struct self_contained_vector
{
        size_t max_size() const { return N; }
        size_t size() const { return size_; }
private:
        size_t size_;
        aligned_storage<T> data_[N];

        //...implement random access container...
};

Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: keyserver x-hkp://pool.sks-keyservers.net

iEYEARECAAYFAk9P2GcACgkQhAOUmAZhnmqtdACfa6D7j8THF2UtGvTSSHERbffe
i6UAn2d+bW1jREGupp1wPMVafXiKQpOm
=mwRW
-----END PGP SIGNATURE-----


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