Changeset e8ebed9 in mainline
- Timestamp:
- 2018-07-05T21:41:22Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a7da64d
- Parents:
- 48f09f2f
- git-author:
- Dzejrou <dzejrou@…> (2018-05-01 20:49:14)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:22)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/map.hpp
r48f09f2f re8ebed9 270 270 */ 271 271 272 // TODO: 272 mapped_type& operator[](const key_type& key) 273 { 274 auto parent = tree_.find_parent_for_insertion(key); 275 if (parent && tree_.keys_equal(tree_.get_key(parent->value), key)) 276 return parent->value.second; 277 278 auto node = new node_type{value_type{key, mapped_type{}}}; 279 tree_.insert_node(node, parent); 280 281 return node->value.second; 282 } 283 284 mapped_type& operator[](key_type&& key) 285 { 286 auto parent = tree_.find_parent_for_insertion(key); 287 if (parent && tree_.keys_equal(tree_.get_key(parent->value), key)) 288 return parent->value.second; 289 290 auto node = new node_type{value_type{move(key), mapped_type{}}}; 291 tree_.insert_node(node, parent); 292 293 return node->value.second; 294 } 273 295 274 296 /** … … 505 527 aux::rbtree_single_policy 506 528 >; 529 530 using node_type = typename tree_type::node_type; 507 531 508 532 tree_type tree_;
Note:
See TracChangeset
for help on using the changeset viewer.