Changeset 2cb7f53 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:
4f080f2a
Parents:
8830faa
git-author:
Dzejrou <dzejrou@…> (2018-04-29 20:21:43)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:22)
Message:

cpp: fixed constness in unordered_set comparison operators

File:
1 edited

Legend:

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

    r8830faa r2cb7f53  
    450450
    451451            template<class K, class H, class P, class A>
    452             friend bool operator==(unordered_set<K, H, P, A>&,
    453                                    unordered_set<K, H, P, A>&);
     452            friend bool operator==(const unordered_set<K, H, P, A>&,
     453                                   const unordered_set<K, H, P, A>&);
    454454    };
    455455
     
    866866
    867867            template<class K, class H, class P, class A>
    868             friend bool operator==(unordered_multiset<K, H, P, A>&,
    869                                    unordered_multiset<K, H, P, A>&);
     868            friend bool operator==(const unordered_multiset<K, H, P, A>&,
     869                                   const unordered_multiset<K, H, P, A>&);
    870870    };
    871871
     
    887887
    888888    template<class Key, class Hash, class Pred, class Alloc>
    889     bool operator==(unordered_set<Key, Hash, Pred, Alloc>& lhs,
    890                     unordered_set<Key, Hash, Pred, Alloc>& rhs)
     889    bool operator==(const unordered_set<Key, Hash, Pred, Alloc>& lhs,
     890                    const unordered_set<Key, Hash, Pred, Alloc>& rhs)
    891891    {
    892892        return lhs.table_.is_eq_to(rhs.table_);
     
    894894
    895895    template<class Key, class Hash, class Pred, class Alloc>
    896     bool operator!=(unordered_set<Key, Hash, Pred, Alloc>& lhs,
    897                     unordered_set<Key, Hash, Pred, Alloc>& rhs)
     896    bool operator!=(const unordered_set<Key, Hash, Pred, Alloc>& lhs,
     897                    const unordered_set<Key, Hash, Pred, Alloc>& rhs)
    898898    {
    899899        return !(lhs == rhs);
     
    901901
    902902    template<class Key, class Hash, class Pred, class Alloc>
    903     bool operator==(unordered_multiset<Key, Hash, Pred, Alloc>& lhs,
    904                     unordered_multiset<Key, Hash, Pred, Alloc>& rhs)
     903    bool operator==(const unordered_multiset<Key, Hash, Pred, Alloc>& lhs,
     904                    const unordered_multiset<Key, Hash, Pred, Alloc>& rhs)
    905905    {
    906906        return lhs.table_.is_eq_to(rhs.table_);
     
    908908
    909909    template<class Key, class Value, class Hash, class Pred, class Alloc>
    910     bool operator!=(unordered_multiset<Key, Hash, Pred, Alloc>& lhs,
    911                     unordered_multiset<Key, Hash, Pred, Alloc>& rhs)
     910    bool operator!=(const unordered_multiset<Key, Hash, Pred, Alloc>& lhs,
     911                    const unordered_multiset<Key, Hash, Pred, Alloc>& rhs)
    912912    {
    913913        return !(lhs == rhs);
Note: See TracChangeset for help on using the changeset viewer.