Update 1.1.0.md

This commit is contained in:
Leonid Stryzhevskyi 2020-05-10 08:18:20 +03:00 committed by GitHub
parent be084689fe
commit 5b512f3cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,11 +61,13 @@ Example:
```cpp
oatpp::Vector<oatpp::String> vector = oatpp::Vector<oatpp::String>::createShared();
oatpp::List<oatpp::String> list = oatpp::List<oatpp::String>::createShared();
oatpp::UnorderedSet<oatpp::String> set = oatpp::UnorderedSet<oatpp::String>::createShared();
oatpp::Fields<oatpp::String> pairList= oatpp::Fields<oatpp::String>::createShared();
oatpp::UnorderedFields<oatpp::String> hashMap = oatpp::UnorderedFields<oatpp::String>::createShared();
oatpp::Vector<oatpp::String> vector = {"a", "b", "c"};
oatpp::List<oatpp::String> list = {"a", "b", "c"};
oatpp::UnorderedSet<oatpp::String> set = {"a", "b", "c"};
oatpp::Fields<oatpp::String> pairList = {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}};
oatpp::UnorderedFields<oatpp::String> hashMap = {{"k1", "v1"}, {"k2", "v2"}, {"k3", "v3"}};
@ -75,6 +77,9 @@ vector->push_back("www");
list[0] = "z"; // <--- Complexity = O(n);
list->push_back("www");
bool contains = set["b"]; // <--- Complexity = O(1);
set->insert("z")
pairList["k1"] = "z"; // <--- Complexity = O(n);
pairList->push_back({"key_z", "z"});
@ -89,6 +94,10 @@ for(auto& item : *list) {
...
}
for(auto& item : *set) {
...
}
for(auto& pair : *pairList) {
...
}