title: Ambiguous call to std/boost move
body: <p>Came across this code which doesn't compile:</p>
  
  <pre><code>#include &lt;boost/move/utility.hpp&gt;
  #include &lt;utility&gt;
  #include &lt;deque&gt;
  #include &lt;map&gt;
  #include &lt;vector&gt;
  #include &lt;boost/date_time/posix_time/posix_time_types.hpp&gt;
  
  using namespace std;
  
  int main() {
      typedef std::pair&lt;int, std::deque&lt;int&gt;&gt; FirstPair;
      typedef std::vector&lt;FirstPair&gt; VectorFirstPair;
      typedef std::pair&lt;boost::posix_time::time_duration, VectorFirstPair&gt; SecondPair;
      typedef std::map&lt;boost::posix_time::time_duration, SecondPair&gt; Map;
      Map mapInstance;
      SecondPair newElement = make_pair(boost::posix_time::not_a_date_time, VectorFirstPair());
      mapInstance.insert(make_pair(boost::posix_time::seconds(10), move(newElement))).first;
  }
  </code></pre>
  
  <p>This fails on gcc 4.8.2 using boost 1.55 (not on boost 1.54) with the following error (ideone <a href="http://ideone.com/pjbnVo" rel="noreferrer">here</a>):</p>
  
  <pre><code>test.cpp: In function ‘int main()’:
  test.cpp:17:81: error: call of overloaded ‘move(SecondPair&amp;)’ is ambiguous
       mapInstance.insert(make_pair(boost::posix_time::seconds(10), move(newElement))).first;
                                                                                   ^
  test.cpp:17:81: note: candidates are:
  In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
                   from /usr/include/c++/4.8/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 test.cpp:1:
  /usr/include/c++/4.8/bits/move.h:101:5: note: constexpr typename std::remove_reference&lt; &lt;template-parameter-1-1&gt; &gt;::type&amp;&amp; std::move(_Tp&amp;&amp;) [with _Tp = std::pair&lt;boost::posix_time::time_duration, std::vector&lt;std::pair&lt;int, std::deque&lt;int&gt; &gt; &gt; &gt;&amp;; typename std::remove_reference&lt; &lt;template-parameter-1-1&gt; &gt;::type = std::pair&lt;boost::posix_time::time_duration, std::vector&lt;std::pair&lt;int, std::deque&lt;int&gt; &gt; &gt; &gt;]
       move(_Tp&amp;&amp; __t) noexcept
       ^
  In file included from test.cpp:1:0:
  /usr/include/boost/move/utility.hpp:138:55: note: typename boost::remove_reference&lt;T&gt;::type&amp;&amp; boost::move(T&amp;&amp;) [with T = std::pair&lt;boost::posix_time::time_duration, std::vector&lt;std::pair&lt;int, std::deque&lt;int&gt; &gt; &gt; &gt;&amp;; typename boost::remove_reference&lt;T&gt;::type = std::pair&lt;boost::posix_time::time_duration, std::vector&lt;std::pair&lt;int, std::deque&lt;int&gt; &gt; &gt; &gt;]
            inline typename remove_reference&lt;T&gt;::type &amp;&amp; move(T&amp;&amp; t) BOOST_NOEXCEPT
  </code></pre>
  
  <p>Shouldn't this compile? Shouldn't the <code>using namespace</code> clause make this unambiguous? Why is the compiler choosing <code>boost::move</code> as a viable candidate here?</p>
  
  <p>Note that this doesn't cause any errors if I remove the <code>boost</code> types in the types defined (replacing them with e.g. <code>int</code>).</p>