Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template small_vector

Boost , The Boost C++ Libraries BoostBook Documentation Subset , Boost.Container Header Reference

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template small_vector

boost::container::small_vector

Synopsis

// In header: <boost/container/small_vector.hpp>
template<typename T, std::size_t N, typename Allocator = new_allocator<T> > 
class small_vector :
  public boost::container::small_vector_base< T, Allocator >
{
public:
  // construct/copy/destruct
  small_vector() noexcept(container_detail::is_nothrow_default_constructible< Allocator >::value));
  explicit small_vector(const allocator_type &);
  explicit small_vector(size_type);
  small_vector(size_type, const allocator_type &);
  small_vector(size_type, default_init_t);
  small_vector(size_type, default_init_t, const allocator_type &);
  small_vector(size_type, const value_type &);
  small_vector(size_type, const value_type &, const allocator_type &);
  template<typename InIt> small_vector(InIt, InIt last );
  template<typename InIt> small_vector(InIt, InIt, const allocator_type &a );
  small_vector(const small_vector &);
  small_vector(const small_vector &, const allocator_type &);
  explicit small_vector(const base_type &);
  explicit small_vector(base_type &&);
  small_vector(small_vector &&);
  small_vector(small_vector &&, const allocator_type &);
  small_vector(std::initializer_list< value_type >, 
               const allocator_type & = allocator_type());
  small_vector & operator=(const small_vector &);
  small_vector & operator=(small_vector &&);
  small_vector & operator=(const base_type &);
  small_vector & operator=(base_type &&);
  // public member functions
  void swap(small_vector &);
};

Description

small_vector представляет собой векторный контейнер, оптимизированный для случая, когда он содержит мало элементов. Он содержит некоторые предварительно выделенные элементы на месте, что позволяет избежать использования динамического распределения памяти, когда фактическое количество элементов ниже этого предварительно выделенного порога.

small_vector конвертируется в small_vector_base, который не зависит от предварительно выделенной емкости элемента, поэтому клиентский код не должен быть шаблонизирован на этом аргументе N.

Все функции boost::container::vector являются наследственными. См. vector документацию для деталей.

Template Parameters

  1. typename T

    The type of object that is stored in the small_vector

  2. std::size_t N

    The number of preallocated elements stored inside small_vector. It shall be less than Allocator::max_size();

  3. Аллокатор, используемый для управления памятью, когда количество элементов превышает N.

    The allocator used for memory management when the number of elements exceeds N.

    [ORIG_END] -->

small_vector public construct/copy/destruct

  1. small_vector()(container_detail::is_nothrow_default_constructible<::;
  2. explicit mall_vector(const allocator_type & a;;
  3. explicit small_vector(size_type n);
  4. small_vector(size_type n, const allocator_type & a;;
  5. small_vectorsize_type n, default_init_t;
  6. small_vector(size_type n, default_init_t, const allocator_type & a;
  7. small_vector(ize_type n, const value_type & v;
  8. small_vector(ize_type n, const value_type , ,  
  9. template<typenameInIt>small_vector(InItfirst,InItlastBOOST_CONTAINER_DOCIGN
  10. templatetypename InIt>mall_vector(InIt first,InIt last,const allocator_type &aBOOST_CONTAINER_DOCIGN;
  11. small_vector(const small_vector& other;
  12. small_vector(const mall_vector & other, const allocator_type & a;
  13. explicit mall_vector(const base_type& other;
  14. explicitmall_vector(base_type&& other;;
  15. small_vectormall_vector && other;
  16. small_vector(mall_vector && other, const allocator_type & a;
  17. std::инициализатор_list< значение_type >il, конст allocator_type & ;
  18. small_vector & оператор=(конст mall_vector & другие;
  19. small_vector &оператор=(mall_vector && прочее;
  20. малый_вектор & оператор=(конст base_type & прочее;;
  21. малый_вектор&оператор=(base_type&& прочий;

small_vector public member functions

  1. void swap(small_vector& other;

PrevUpHomeNext

Статья Class template small_vector раздела The Boost C++ Libraries BoostBook Documentation Subset Boost.Container Header Reference может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Boost.Container Header Reference ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 02:40:26/0.026178121566772/1