Changeset b7cc0a9 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:23Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
349b0f7
Parents:
0fe0f32
git-author:
Dzejrou <dzejrou@…> (2018-05-14 17:55:53)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: fixed bugs found by set tests and fixed the enable_ifs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/impl/set.hpp

    r0fe0f32 rb7cc0a9  
    6262            using difference_type = ptrdiff_t;
    6363
     64            using node_type = aux::rbtree_single_node<value_type>;
     65
    6466            /**
    6567             * Note: Both the iterator and const_iterator (and their local variants)
     
    6870             */
    6971            using iterator             = aux::rbtree_const_iterator<
    70                 value_type, const_reference, const_pointer, size_type
     72                value_type, const_reference, const_pointer, size_type, node_type
    7173            >;
    7274            using const_iterator       = iterator;
     
    341343            template<class K>
    342344            iterator find(
    343                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     345                const K& key,
     346                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    344347            )
    345348            {
     
    349352            template<class K>
    350353            const_iterator find(
    351                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     354                const K& key,
     355                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    352356            ) const
    353357            {
     
    362366            template<class K>
    363367            size_type count(
    364                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     368                const K& key,
     369                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    365370            ) const
    366371            {
     
    380385            template<class K>
    381386            iterator lower_bound(
    382                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     387                const K& key,
     388                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    383389            )
    384390            {
     
    388394            template<class K>
    389395            const_iterator lower_bound(
    390                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     396                const K& key,
     397                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    391398            ) const
    392399            {
     
    406413            template<class K>
    407414            iterator upper_bound(
    408                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     415                const K& key,
     416                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    409417            )
    410418            {
     
    414422            template<class K>
    415423            const_iterator upper_bound(
    416                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     424                const K& key,
     425                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    417426            ) const
    418427            {
     
    432441            template<class K>
    433442            pair<iterator, iterator> equal_range(
    434                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     443                const K& key,
     444                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    435445            )
    436446            {
     
    440450            template<class K>
    441451            pair<const_iterator, const_iterator> equal_range(
    442                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     452                const K& key,
     453                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    443454            ) const
    444455            {
     
    451462                key_compare, allocator_type, size_type,
    452463                iterator, const_iterator,
    453                 aux::rbtree_single_policy
     464                aux::rbtree_single_policy, node_type
    454465            >;
    455466
     
    532543            using difference_type = ptrdiff_t;
    533544
     545            using node_type = aux::rbtree_multi_node<value_type>;
     546
    534547            /**
    535              * Note: Both the iterator and const_iterator (and their local variants)
    536              *       types are constant iterators, the standard does not require them
     548             * Note: Both the iterator and const_iterator types are constant
     549             *       iterators, the standard does not require them
    537550             *       to be the same type, but why not? :)
    538551             */
    539552            using iterator             = aux::rbtree_const_iterator<
    540                 value_type, const_reference, const_pointer, size_type
     553                value_type, const_reference, const_pointer, size_type, node_type
    541554            >;
    542555            using const_iterator       = iterator;
     
    811824            template<class K>
    812825            iterator find(
    813                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     826                const K& key,
     827                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    814828            )
    815829            {
     
    819833            template<class K>
    820834            const_iterator find(
    821                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     835                const K& key,
     836                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    822837            ) const
    823838            {
     
    832847            template<class K>
    833848            size_type count(
    834                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     849                const K& key,
     850                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    835851            ) const
    836852            {
     
    850866            template<class K>
    851867            iterator lower_bound(
    852                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     868                const K& key,
     869                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    853870            )
    854871            {
     
    858875            template<class K>
    859876            const_iterator lower_bound(
    860                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     877                const K& key,
     878                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    861879            ) const
    862880            {
     
    876894            template<class K>
    877895            iterator upper_bound(
    878                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     896                const K& key,
     897                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    879898            )
    880899            {
     
    884903            template<class K>
    885904            const_iterator upper_bound(
    886                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     905                const K& key,
     906                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    887907            ) const
    888908            {
     
    902922            template<class K>
    903923            pair<iterator, iterator> equal_range(
    904                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     924                const K& key,
     925                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    905926            )
    906927            {
     
    910931            template<class K>
    911932            pair<const_iterator, const_iterator> equal_range(
    912                 enable_if_t<aux::is_transparent_v<key_compare>, const K&> key
     933                const K& key,
     934                enable_if_t<aux::is_transparent_v<key_compare>, K>* = nullptr
    913935            ) const
    914936            {
     
    921943                key_compare, allocator_type, size_type,
    922944                iterator, const_iterator,
    923                 aux::rbtree_multi_policy
     945                aux::rbtree_multi_policy, node_type
    924946            >;
    925947
Note: See TracChangeset for help on using the changeset viewer.