fork(2) download
  1. #include <boost/move/utility.hpp>
  2. #include <utility>
  3. #include <deque>
  4. #include <map>
  5. #include <vector>
  6. #include <boost/date_time/posix_time/posix_time_types.hpp>
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11. typedef std::pair<int, std::deque<int>> FirstPair;
  12. typedef std::vector<FirstPair> VectorFirstPair;
  13. typedef std::pair<boost::posix_time::time_duration, VectorFirstPair> SecondPair;
  14. typedef std::map<boost::posix_time::time_duration, SecondPair> Map;
  15. Map mapInstance;
  16. SecondPair newElement = make_pair(boost::posix_time::not_a_date_time, VectorFirstPair());
  17. mapInstance.insert(make_pair(boost::posix_time::seconds(10), move(newElement))).first;
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:17:81: error: call of overloaded 'move(SecondPair&)' is ambiguous
     mapInstance.insert(make_pair(boost::posix_time::seconds(10), move(newElement))).first;
                                                                                 ^
prog.cpp:17:81: note: candidates are:
In file included from /usr/include/c++/4.9/bits/stl_pair.h:59:0,
                 from /usr/include/c++/4.9/utility:70,
                 from /usr/include/boost/config/no_tr1/utility.hpp:21,
                 from /usr/include/boost/config/select_stdlib_config.hpp:37,
                 from /usr/include/boost/config.hpp:40,
                 from /usr/include/boost/move/detail/config_begin.hpp:10,
                 from /usr/include/boost/move/utility.hpp:17,
                 from prog.cpp:1:
/usr/include/c++/4.9/bits/move.h:101:5: note: constexpr typename std::remove_reference< <template-parameter-1-1> >::type&& std::move(_Tp&&) [with _Tp = std::pair<boost::posix_time::time_duration, std::vector<std::pair<int, std::deque<int> > > >&; typename std::remove_reference< <template-parameter-1-1> >::type = std::pair<boost::posix_time::time_duration, std::vector<std::pair<int, std::deque<int> > > >]
     move(_Tp&& __t) noexcept
     ^
In file included from prog.cpp:1:0:
/usr/include/boost/move/utility.hpp:138:55: note: typename boost::remove_reference<T>::type&& boost::move(T&&) [with T = std::pair<boost::posix_time::time_duration, std::vector<std::pair<int, std::deque<int> > > >&; typename boost::remove_reference<T>::type = std::pair<boost::posix_time::time_duration, std::vector<std::pair<int, std::deque<int> > > >]
          inline typename remove_reference<T>::type && move(T&& t) BOOST_NOEXCEPT
                                                       ^
stdout
Standard output is empty