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:
6175b78
Parents:
f6f636f
git-author:
Dzejrou <dzejrou@…> (2018-05-12 21:01:13)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: fixed bugs found by the tuple tests

File:
1 edited

Legend:

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

    rf6f636f r9c9ee5d  
    5050    {
    5151        template<class T, class U>
    52         static void assign(T&& lhs, U&& rhs)
     52        static void assign_copy(T& lhs, const U& rhs)
    5353        {
    54             get<I>(forward<T>(lhs)) = get<I>(forward<U>(rhs));
     54            get<I>(lhs) = get<I>(rhs);
    5555
    56             tuple_ops<I + 1, N>::assign(forward<T>(lhs), forward<U>(rhs));
     56            tuple_ops<I + 1, N>::assign_copy(lhs, rhs);
     57        }
     58
     59        template<class T, class U>
     60        static void assign_move(T& lhs, U&& rhs)
     61        {
     62            get<I>(lhs) = move(get<I>(rhs));
     63
     64            tuple_ops<I + 1, N>::assign_move(lhs, move(rhs));
    5765        }
    5866
     
    8391    {
    8492        template<class T, class U>
    85         static void assign(T&& lhs, U&& rhs)
     93        static void assign_copy(T& lhs, const U& rhs)
    8694        {
    87             get<N>(forward<T>(lhs)) = get<N>(forward<U>(rhs));
     95            get<N>(lhs) = get<N>(rhs);
     96        }
     97
     98        template<class T, class U>
     99        static void assign_move(T& lhs, U&& rhs)
     100        {
     101            get<N>(lhs) = move(get<N>(rhs));
    88102        }
    89103
Note: See TracChangeset for help on using the changeset viewer.