Changeset 784c8b6 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:22Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd2baf8
Parents:
a2f01c4
git-author:
Dzejrou <dzejrou@…> (2018-04-30 20:19:12)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:22)
Message:

cpp: fixed formatting and fixed insert/emplace return type

File:
1 edited

Legend:

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

    ra2f01c4 r784c8b6  
    757757
    758758            explicit unordered_multimap(size_type bucket_count,
    759                                    const hasher& hf = hasher{},
    760                                    const key_equal& eql = key_equal{},
    761                                    const allocator_type& alloc = allocator_type{})
     759                                        const hasher& hf = hasher{},
     760                                        const key_equal& eql = key_equal{},
     761                                        const allocator_type& alloc = allocator_type{})
    762762                : table_{bucket_count, hf, eql}, allocator_{alloc}
    763763            { /* DUMMY BODY */ }
     
    765765            template<class InputIterator>
    766766            unordered_multimap(InputIterator first, InputIterator last,
    767                           size_type bucket_count = default_bucket_count_,
    768                           const hasher& hf = hasher{},
    769                           const key_equal& eql = key_equal{},
    770                           const allocator_type& alloc = allocator_type{})
     767                               size_type bucket_count = default_bucket_count_,
     768                               const hasher& hf = hasher{},
     769                               const key_equal& eql = key_equal{},
     770                               const allocator_type& alloc = allocator_type{})
    771771                : unordered_multimap{bucket_count, hf, eql, alloc}
    772772            {
     
    795795
    796796            unordered_multimap(initializer_list<value_type> init,
    797                           size_type bucket_count = default_bucket_count_,
    798                           const hasher& hf = hasher{},
    799                           const key_equal& eql = key_equal{},
    800                           const allocator_type& alloc = allocator_type{})
     797                               size_type bucket_count = default_bucket_count_,
     798                               const hasher& hf = hasher{},
     799                               const key_equal& eql = key_equal{},
     800                               const allocator_type& alloc = allocator_type{})
    801801                : unordered_multimap{bucket_count, hf, eql, alloc}
    802802            {
     
    808808            { /* DUMMY BODY */ }
    809809
    810             unordered_multimap(size_type bucket_count, const hasher& hf, const allocator_type& alloc)
     810            unordered_multimap(size_type bucket_count, const hasher& hf,
     811                               const allocator_type& alloc)
    811812                : unordered_multimap{bucket_count, hf, key_equal{}, alloc}
    812813            { /* DUMMY BODY */ }
     
    814815            template<class InputIterator>
    815816            unordered_multimap(InputIterator first, InputIterator last,
    816                           size_type bucket_count, const allocator_type& alloc)
     817                               size_type bucket_count, const allocator_type& alloc)
    817818                : unordered_multimap{first, last, bucket_count, hasher{}, key_equal{}, alloc}
    818819            { /* DUMMY BODY */ }
     
    820821            template<class InputIterator>
    821822            unordered_multimap(InputIterator first, InputIterator last,
    822                           size_type bucket_count, const hasher& hf, const allocator_type& alloc)
     823                               size_type bucket_count, const hasher& hf,
     824                               const allocator_type& alloc)
    823825                : unordered_multimap{first, last, bucket_count, hf, key_equal{}, alloc}
    824826            { /* DUMMY BODY */ }
    825827
    826828            unordered_multimap(initializer_list<value_type> init, size_type bucket_count,
    827                           const allocator_type& alloc)
     829                               const allocator_type& alloc)
    828830                : unordered_multimap{init, bucket_count, hasher{}, key_equal{}, alloc}
    829831            { /* DUMMY BODY */ }
    830832
    831833            unordered_multimap(initializer_list<value_type> init, size_type bucket_count,
    832                           const hasher& hf, const allocator_type& alloc)
     834                               const hasher& hf, const allocator_type& alloc)
    833835                : unordered_multimap{init, bucket_count, hf, key_equal{}, alloc}
    834836            { /* DUMMY BODY */ }
     
    917919
    918920            template<class... Args>
    919             pair<iterator, bool> emplace(Args&&... args)
     921            iterator emplace(Args&&... args)
    920922            {
    921923                return table_.emplace(forward<Args>(args)...);
     
    925927            iterator emplace_hint(const_iterator, Args&&... args)
    926928            {
    927                 return emplace(forward<Args>(args)...).first;
    928             }
    929 
    930             pair<iterator, bool> insert(const value_type& val)
     929                return emplace(forward<Args>(args)...);
     930            }
     931
     932            iterator insert(const value_type& val)
    931933            {
    932934                return table_.insert(val);
    933935            }
    934936
    935             pair<iterator, bool> insert(value_type&& val)
     937            iterator insert(value_type&& val)
    936938            {
    937939                return table_.insert(forward<value_type>(val));
     
    942944                class = enable_if_t<is_constructible_v<value_type, T&&>, void>
    943945            >
    944             pair<iterator, bool> insert(T&& val)
     946            iterator insert(T&& val)
    945947            {
    946948                return emplace(forward<T>(val));
     
    949951            iterator insert(const_iterator, const value_type& val)
    950952            {
    951                 return insert(val).first;
     953                return insert(val);
    952954            }
    953955
    954956            iterator insert(const_iterator, value_type&& val)
    955957            {
    956                 return insert(forward<value_type>(val)).first;
     958                return insert(forward<value_type>(val));
    957959            }
    958960
Note: See TracChangeset for help on using the changeset viewer.