From 52f53e8c8ea9320e2af86d6e1a09f1416a73d51c Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 24 Mar 2021 14:39:50 +0100 Subject: More README.md edit. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2ace5dbb..9c26dc70 100644 --- a/README.md +++ b/README.md @@ -200,19 +200,19 @@ elements using dynamic memory. | push_front() | emplace_front() | cdeq, clist | | insert_after() | emplace_after() | clist | -Note these differences between STC and c++ STL maps: +For containers of integral or trivial element types, **emplace** and corresponding non-emplace +methods are identical, so the following does not apply for those. + +The **emplace** methods ***construct*** or ***clone*** their own copy of the element to be added. +In contrast, the non-emplace methods requires elements to be explicitly constructed or cloned before adding them. + +A few of the differences between STC and c++ STL maps methods are: | STC maps | C++ STL maps | |:-------------------------------------|:------------------------------| | insert(Key, Mapped) | insert(Value) | | emplace_or_assign(RawKey, RawMapped) | N/A | -For containers of integral or trivial element types, **emplace** and corresponding -non-emplace methods are identical, so the following does not apply for those. - -The **emplace** methods ***construct*** or ***clone*** their own copy of the element to be added. -In contrast, the non-emplace methods requires elements to be explicitly constructed or cloned before adding them. - Strings are the most commonly used non-trivial data type. STC containers have proper pre-defined **using**-declarations for cstr-elements, so they are fail-safe to use both with the **emplace** and non-emplace methods: -- cgit v1.2.3