This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/51183] pair piecewise_construct_t constructor copies


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51183

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-05 16:06:57 UTC ---
Nice!

it should be pretty simple:

      template<class... _Args1, class... _Args2>
        pair(piecewise_construct_t,
             tuple<_Args1...> __first, tuple<_Args2...> __second)
        : pair(std::move(__first), std::move(__second),
               typename _Build_index_tuple<sizeof...(_Args1)>::__type(),
               typename _Build_index_tuple<sizeof...(_Args2)>::__type())
        { }


      template<typename... _Args2, std::size_t... _Indexes1,
               typename... _Args2, std::size_t... _Indexes2>
        explicit
        pair(tuple<_Args1...> __tuple1, tuple<_Args2> __tuple2,
             _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>)
        : first(std::forward<_Args1>(get<_Indexes1>(__tuple1))...),
          second(std::forward<_Args2>(get<_Indexes2>(__tuple2))...)
        { }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]