Changeset adee838 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:
78449b15
Parents:
b024c0c9
git-author:
Dzejrou <dzejrou@…> (2018-05-14 17:01:51)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: added move assignment and swap for pairs

File:
1 edited

Legend:

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

    rb024c0c9 radee838  
    264264            return *this;
    265265        }
     266
     267        template<typename U, typename V>
     268        pair& operator=(pair<U, V>&& other)
     269        {
     270            first = forward<first_type>(other.first);
     271            second = forward<second_type>(other.second);
     272
     273            return *this;
     274        }
     275
     276        void swap(pair& other) noexcept(
     277            noexcept(std::swap(first, other.first)) &&
     278            noexcept(std::swap(second, other.second))
     279        )
     280        {
     281            std::swap(first, other.first);
     282            std::swap(second, other.second);
     283        }
    266284    };
    267285
Note: See TracChangeset for help on using the changeset viewer.