2.2 Vector

The Vector class provides basically the same features as the Array1D class. Vector is just a word easyer to type in, and lot of people are used to this name for a 1 dimensional container.

See Section 2.1 for a complete reference of the Array1D class, and hence the documentation for the Vector class.


Synopsis


  #include <lyric/Vector.hpp>
  
  template <class VIT>
  class Vector : public Array1D<VIT>
  {
  public:
    ~Vector ();
    Vector ();
    Vector (Size size)
      throw (Exception::Memory::Alloc);
    Vector (const Vector& vector)
      throw (Exception::Memory::Alloc);
    Vector& operator = (const VIT& val);
    Vector& operator = (const Vector& vector)
      throw (Exception::Memory::Alloc);
  
    // Inherited from Array1D, see Section 2.1
    Size size () const;
    void create (Size size)
      throw (Exception::Memory::Alloc);
    void create (const AIT* block, Size size)
      throw (Exception::Memory::Alloc);
    void resize (Size newsize)
      throw (Exception::Memory::Alloc);
    void move (Size size, Size src, Size dest)
      throw (Exception::Memory::Move);
    void destroy ();
    VIT& operator [] (Size index)
      throw (Exception::Memory::Range);
    const VIT& operator [] (Size index) const
      throw (Exception::Memory::Range);
  };