Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Container

 

A class for containing one or multiple instances of a data types.

 

This page is about one-dimensional containers (that is a container in which one value is needed to retrieve an element). For two-dimensional containers, go to the matrix page.

 

 

 

 

 

STL containers (incomplete list)

0.              std::bitset

1.              std::deque

2.              std::list

3.              std::map

4.              std::multimap

5.              std::multiset

6.              std::pair

7.              std::priority_queue

8.              std::set

9.              std::slist

10.         std::stack

11.         std::string

12.         std::queue

13.         std::valarray

14.         std::vector

 

 

 

 

 

SGI extension containers (incomplete list)

0.              bit_vector

1.              hash_set

2.              hash_map

3.              hash_multiset

4.              hash_multimap

5.              hash

6.              rope

 

 

 

 

 

Boost containers (incomplete list)

0.              boost::any

1.              boost::array

2.              boost::compressed_pair

3.              boost::dynamic_bitset

4.              boost::multiArray

5.              boost::ptr_array

6.              boost::ptr_deque

7.              boost::ptr_list

8.              boost::ptr_map

9.              boost::ptr_multimap

10.         boost::ptr_multiset

11.         boost::ptr_set

12.         boost::ptr_vector

13.         boost::shared_array

14.         boost::tuple

15.         boost::variant

 

Every container has its own advantages and disadvantages. For example a std::vector has random-access reading/writing, but new elements can only be added at the begin and end of the container. For a std::list, this is the other way around.

 

 

 

 

 

Container code snippets

 

For two-dimensional containers, go to the matrix page.

 

0.              CoutContainer, std::cout a container

1.              Get the mean value of all elements in a container, GetMean

2.              Get the sum of all elements in a container, GetSum

3.              GetMean, get the mean value of all elements in a container

4.              GetSum, get the sum of all elements in a container

5.              LoopReader, reading a container looped

6.              Reading a container looped, LoopReader

7.              Reciprocal, replace all values in a container by their reciprocal

8.              Replace all values in a container by their reciprocal, Reciprocal

9.              Save a container to file, SaveContainer

10.         SaveContainer, save a container to file

11.         std::cout a container, CoutContainer

12.         Triple all values in a container, Triple

13.         Triple, triple all values in a container

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.