Почему libstdc++ часто использует базовые классы для контейнеров STL [дубликат] ⇐ C++
Почему libstdc++ часто использует базовые классы для контейнеров STL [дубликат]
I noticed that libstdc++ often uses a base class for the implementation of standard allocator-aware containers. Especially, some basic functionalities are implemented in a base class that is inherited by the correponding container class, like std::vector, std::deque, std::forward_list and std::list.
The comments in the header files do not offer an explanation for this design choice, and the comment in the stl_deque.h file just says that the technique makes exception safety easier.
Pedantically, how would the base class make exception safety easier?
Источник: https://stackoverflow.com/questions/781 ... containers
I noticed that libstdc++ often uses a base class for the implementation of standard allocator-aware containers. Especially, some basic functionalities are implemented in a base class that is inherited by the correponding container class, like std::vector, std::deque, std::forward_list and std::list.
The comments in the header files do not offer an explanation for this design choice, and the comment in the stl_deque.h file just says that the technique makes exception safety easier.
Pedantically, how would the base class make exception safety easier?
Источник: https://stackoverflow.com/questions/781 ... containers
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
C++: скопируйте контейнер STL в контейнер STL, используя лямбда-выражение
Anonymous » » в форуме C++ - 0 Ответы
- 41 Просмотры
-
Последнее сообщение Anonymous
-
-
-
C++: скопируйте контейнер STL в контейнер STL, используя лямбда-выражение
Anonymous » » в форуме C++ - 0 Ответы
- 32 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Почему в контейнерах STL в контейнерах STL нет перегрузки RVALUE Ref-квалификации?
Anonymous » » в форуме C++ - 0 Ответы
- 10 Просмотры
-
Последнее сообщение Anonymous
-