Name

boost::array: This is a STL compliant container wrapper for arrays of constant size.


Synopsis

template<typename T, std::size_t N> 
class array {
public:
  // types
  typedef T                                     value_type;            
  typedef T*                                    iterator;              
  typedef const T*                              const_iterator;        
  typedef std::reverse_iterator<iterator>       reverse_iterator;      
  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
  typedef T&                                    reference;             
  typedef const T&                              const_reference;       
  typedef std::size_t                           size_type;             
  typedef std::ptrdiff_t                        difference_type;       

  // static constants
  static const size_type static_size = N;

  // construct/copy/destruct
  template<typename U> array& operator=(const array<U, N>&);

  // iterator support
  iterator begin();
  const_iterator begin() const;
  iterator end();
  const_iterator end() const;

  // reverse iterator support
  reverse_iterator rbegin();
  const_reverse_iterator rbegin() const;
  reverse_iterator rend();
  const_reverse_iterator rend() const;

  // capacity
  size_type size();
  bool empty();
  size_type max_size();

  // element access
  reference operator[](size_type);
  const_reference operator[](size_type) const;
  reference at(size_type);
  const_reference at(size_type) const;
  reference front();
  const_reference front() const;
  reference back();
  const_reference back() const;
  const T* data() const;
  T* c_array();

  // modifiers
  void swap(array<T, N>&);
  void assign(const T&);

  T elems[N];
};

// specialized algorithms
template<typename T, std::size_t N> void swap(array<T, N>&, array<T, N>&);

// comparisons
template<typename T, std::size_t N> 
  bool operator==(const array<T, N>&, const array<T, N>&);
template<typename T, std::size_t N> 
  bool operator!=(const array<T, N>&, const array<T, N>&);
template<typename T, std::size_t N> 
  bool operator<(const array<T, N>&, const array<T, N>&);
template<typename T, std::size_t N> 
  bool operator>(const array<T, N>&, const array<T, N>&);
template<typename T, std::size_t N> 
  bool operator<=(const array<T, N>&, const array<T, N>&);
template<typename T, std::size_t N> 
  bool operator>=(const array<T, N>&, const array<T, N>&);

Detailed Description

Click here for more details.


Limitation

None


Feedback

For additional information or queries on this page send feedback.


© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.

Top

Legal Disclaimer Please note, that by using some of the links in this document you will leave the Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. website and the site you enter is not operated by Nokia. If you choose to access such sites, you should take precautions for security or content. By using the site, you shall review and agree to the site's rules of use before using the site. You agree and acknowledge that Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. has no control over the service and will not assume any liability or responsibility for the availability of the site, nor for any aspects of the service.