Changeset a2f01c4 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:
784c8b6
Parents:
7644d6e
git-author:
Dzejrou <dzejrou@…> (2018-04-30 20:15:36)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:22)
Message:

cpp: fixed return type on multi policy insert and made return type on insert/emplace in hash_table dependent on the policy

Location:
uspace/lib/cpp/include/internal
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/internal/hash_table.hpp

    r7644d6e ra2f01c4  
    190190
    191191            template<class... Args>
    192             pair<iterator, bool> emplace(Args&&... args)
     192            auto emplace(Args&&... args)
    193193            {
    194194                return Policy::emplace(*this, forward<Args>(args)...);
    195195            }
    196196
    197             pair<iterator, bool> insert(const value_type& val)
     197            auto insert(const value_type& val)
    198198            {
    199199                return Policy::insert(*this, val);
    200200            }
    201201
    202             pair<iterator, bool> insert(value_type&& val)
     202            auto insert(value_type&& val)
    203203            {
    204204                return Policy::insert(*this, forward<value_type>(val));
  • uspace/lib/cpp/include/internal/hash_table_policies.hpp

    r7644d6e ra2f01c4  
    366366
    367367        template<class Table, class... Args>
    368         static pair<
    369             typename Table::iterator, bool
    370         > emplace(Table& table, Args&&... args)
     368        static typename Table::iterator emplace(Table& table, Args&&... args)
    371369        {
    372370            using node_type  = typename Table::node_type;
     
    378376
    379377        template<class Table, class Value>
    380         static pair<
    381             typename Table::iterator, bool
    382         > insert(Table& table, const Value& val)
     378        static typename Table::iterator insert(Table& table, const Value& val)
    383379        {
    384380            using node_type  = typename Table::node_type;
     
    390386
    391387        template<class Table, class Value>
    392         static pair<
    393             typename Table::iterator, bool
    394         > insert(Table& table, Value&& val)
     388        static typename Table::iterator insert(Table& table, Value&& val)
    395389        {
    396390            using value_type = typename Table::value_type;
     
    403397
    404398        template<class Table>
    405         static pair<
    406             typename Table::iterator, bool
    407         > insert(Table& table, typename Table::node_type* node)
     399        static typename Table::iterator insert(Table& table, typename Table::node_type* node)
    408400        {
    409401            using iterator   = typename Table::iterator;
     
    422414                bucket->prepend(node);
    423415
    424             return make_pair(iterator{
     416            return iterator{
    425417                table.table(), idx,
    426418                table.bucket_count(),
    427419                node
    428             }, true);
     420            };
    429421        }
    430422    };
Note: See TracChangeset for help on using the changeset viewer.