Changeset 21d97e8 in mainline for uspace/lib/cpp/include/impl/map.hpp
- Timestamp:
- 2018-07-05T21:41:23Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0fe0f32
- Parents:
- 5608106c
- git-author:
- Dzejrou <dzejrou@…> (2018-05-14 17:03:57)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/map.hpp
r5608106c r21d97e8 63 63 using difference_type = ptrdiff_t; 64 64 65 using node_type = aux::rbtree_single_node<value_type>; 66 65 67 using iterator = aux::rbtree_iterator< 66 value_type, reference, pointer, size_type 68 value_type, reference, pointer, size_type, node_type 67 69 >; 68 70 using const_iterator = aux::rbtree_const_iterator< 69 value_type, const_reference, const_pointer, size_type 71 value_type, const_reference, const_pointer, size_type, node_type 70 72 >; 71 73 … … 338 340 template<class T> 339 341 pair<iterator, bool> insert( 340 enable_if_t<is_constructible_v<value_type, T&&>, T&&> val) 342 T&& val, 343 enable_if_t<is_constructible_v<value_type, T&&>>* = nullptr 344 ) 341 345 { 342 346 return emplace(forward<T>(val)); … … 356 360 iterator insert( 357 361 const_iterator hint, 358 enable_if_t<is_constructible_v<value_type, T&&>, T&&> val 362 T&& val, 363 enable_if_t<is_constructible_v<value_type, T&&>>* = nullptr 359 364 ) 360 365 { … … 422 427 if (parent && tree_.keys_equal(tree_.get_key(parent->value), key)) 423 428 { 424 parent->value = value_type{key, forward<T>(val)};429 parent->value.second = forward<T>(val); 425 430 426 431 return make_pair(iterator{parent, false}, false); … … 441 446 if (parent && tree_.keys_equal(tree_.get_key(parent->value), key)) 442 447 { 443 parent->value = value_type{move(key), forward<T>(val)};448 parent->value.second = forward<T>(val); 444 449 445 450 return make_pair(iterator{parent, false}, false); … … 521 526 template<class K> 522 527 iterator find( 523 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 528 const K& key, 529 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 524 530 ) 525 531 { … … 529 535 template<class K> 530 536 const_iterator find( 531 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 537 const K& key, 538 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 532 539 ) const 533 540 { … … 542 549 template<class K> 543 550 size_type count( 544 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 551 const K& key, 552 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 545 553 ) const 546 554 { … … 560 568 template<class K> 561 569 iterator lower_bound( 562 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 570 const K& key, 571 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 563 572 ) 564 573 { … … 568 577 template<class K> 569 578 const_iterator lower_bound( 570 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 579 const K& key, 580 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 571 581 ) const 572 582 { … … 586 596 template<class K> 587 597 iterator upper_bound( 588 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 598 const K& key, 599 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 589 600 ) 590 601 { … … 594 605 template<class K> 595 606 const_iterator upper_bound( 596 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 607 const K& key, 608 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 597 609 ) const 598 610 { … … 612 624 template<class K> 613 625 pair<iterator, iterator> equal_range( 614 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 626 const K& key, 627 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 615 628 ) 616 629 { … … 620 633 template<class K> 621 634 pair<const_iterator, const_iterator> equal_range( 622 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 635 const K& key, 636 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 623 637 ) const 624 638 { … … 631 645 key_compare, allocator_type, size_type, 632 646 iterator, const_iterator, 633 aux::rbtree_single_policy 647 aux::rbtree_single_policy, node_type 634 648 >; 635 636 using node_type = typename tree_type::node_type;637 649 638 650 tree_type tree_; … … 714 726 using difference_type = ptrdiff_t; 715 727 728 using node_type = aux::rbtree_multi_node<value_type>; 729 716 730 class value_compare 717 731 { … … 737 751 738 752 using iterator = aux::rbtree_iterator< 739 value_type, reference, pointer, size_type 753 value_type, reference, pointer, size_type, node_type 740 754 >; 741 755 using const_iterator = aux::rbtree_const_iterator< 742 value_type, const_reference, const_pointer, size_type 756 value_type, const_reference, const_pointer, size_type, node_type 743 757 >; 744 758 … … 937 951 template<class T> 938 952 iterator insert( 939 enable_if_t<is_constructible_v<value_type, T&&>, T&&> val 953 T&& val, 954 enable_if_t<is_constructible_v<value_type, T&&>>* = nullptr 940 955 ) 941 956 { … … 956 971 iterator insert( 957 972 const_iterator hint, 958 enable_if_t<is_constructible_v<value_type, T&&>, T&&> val 973 T&& val, 974 enable_if_t<is_constructible_v<value_type, T&&>>* = nullptr 959 975 ) 960 976 { … … 1029 1045 template<class K> 1030 1046 iterator find( 1031 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1047 const K& key, 1048 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1032 1049 ) 1033 1050 { … … 1037 1054 template<class K> 1038 1055 const_iterator find( 1039 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1056 const K& key, 1057 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1040 1058 ) const 1041 1059 { … … 1050 1068 template<class K> 1051 1069 size_type count( 1052 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1070 const K& key, 1071 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1053 1072 ) const 1054 1073 { … … 1068 1087 template<class K> 1069 1088 iterator lower_bound( 1070 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1089 const K& key, 1090 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1071 1091 ) 1072 1092 { … … 1076 1096 template<class K> 1077 1097 const_iterator lower_bound( 1078 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1098 const K& key, 1099 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1079 1100 ) const 1080 1101 { … … 1094 1115 template<class K> 1095 1116 iterator upper_bound( 1096 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1117 const K& key, 1118 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1097 1119 ) 1098 1120 { … … 1102 1124 template<class K> 1103 1125 const_iterator upper_bound( 1104 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1126 const K& key, 1127 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1105 1128 ) const 1106 1129 { … … 1120 1143 template<class K> 1121 1144 pair<iterator, iterator> equal_range( 1122 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1145 const K& key, 1146 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1123 1147 ) 1124 1148 { … … 1128 1152 template<class K> 1129 1153 pair<const_iterator, const_iterator> equal_range( 1130 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key 1154 const K& key, 1155 enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr 1131 1156 ) const 1132 1157 { … … 1139 1164 key_compare, allocator_type, size_type, 1140 1165 iterator, const_iterator, 1141 aux::rbtree_multi_policy 1166 aux::rbtree_multi_policy, node_type 1142 1167 >; 1143 1168
Note:
See TracChangeset
for help on using the changeset viewer.