Containers store objects. References are not objects.
The C++11 specification clearly states (ยง23.2.1[container.requirements.general]/1):
Containers are objects that store other objects.
More Related Contents:
- c++ push reference node to stl list
- Why can’t I make a vector of references?
- How can I use std::maps with user-defined types as key?
- What are the complexity guarantees of the standard containers?
- Why use iterators instead of array indices?
- Why isn’t vector a STL container?
- Heterogeneous containers in C++
- Copy map values to vector in STL [duplicate]
- What is an iterator’s default value?
- Template class with template container
- What is the right approach when using STL container for median calculation?
- Do STL iterators guarantee validity after collection was changed?
- General use cases for C++ containers
- STL map containing references does not compile
- STL containers with reference to objects [duplicate]
- Best way to extract a subvector from a vector?
- Does vector::erase() on a vector of object pointers destroy the object itself?
- How to update an existing element of std::set?
- constant references with typedef and templates in c++
- Search a vector of objects by object attribute
- C++: Argument Passing “passed by reference”
- STL Rope – when and where to use
- What is the difference between a const reference and normal parameter?
- Why doesn’t std::string provide implicit conversion to char*?
- Getting a vector into a function that expects a vector
- How to sort an STL vector?
- Why isn’t operator overloading for pointers allowed to work?
- C++ strings: [] vs. *
- C++11 std::to_string(double) – No trailing zeros
- C++ inserting unique_ptr in map