Changeset 875788a8 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:21Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
82d256e
Parents:
7a666789
git-author:
Dzejrou <dzejrou@…> (2018-04-24 16:32:18)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:21)
Message:

cpp: added const variants for key extractors, public key extraction function to hash table for use one level above and tested the hash table with key value pairs

File:
1 edited

Legend:

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

    r7a666789 r875788a8  
    5757            return p.first;
    5858        }
     59
     60        const Key& operator()(pair<const Key, Value>& p) const noexcept
     61        {
     62            return p.first;
     63        }
    5964    };
    6065
     
    6368    {
    6469        Key& operator()(Key& k) const noexcept
     70        {
     71            return k;
     72        }
     73
     74        const Key& operator()(const Key& k) const noexcept
    6575        {
    6676            return k;
     
    10781088            }
    10791089
     1090            const key_type& get_key(const value_type& val)
     1091            {
     1092                return key_extractor_(val);
     1093            }
     1094
    10801095        /* private: */
    10811096            hash_table_bucket<value_type, size_type>* table_;
Note: See TracChangeset for help on using the changeset viewer.