Boost C++ Libraries: Ticket #12115: Boost.Asio compile error on Visual Studio 2015 Update 2 https://svn.boost.org/trac10/ticket/12115 <p> I just upgraded to VS 2015 Update 2 and boost/asio/basic_io_object.hpp fails to compile on it. Downgrading to VS 2015 Update 1 fixed this issue for me. </p> <pre class="wiki">1&gt;include\boost/asio/basic_io_object.hpp(45): error C2064: term does not evaluate to a function taking 2 arguments 1&gt; include\boost/asio/ip/basic_resolver.hpp(45): note: see reference to class template instantiation 'boost::asio::detail::service_has_move&lt;IoObjectService&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; IoObjectService=boost::asio::ip::resolver_service&lt;boost::asio::ip::tcp&gt; 1&gt; ] 1&gt; C:\work\uninav\src\private\nav_mail\MailClient.cpp(175): note: see reference to class template instantiation 'boost::asio::ip::basic_resolver&lt;boost::asio::ip::tcp,boost::asio::ip::resolver_service&lt;InternetProtocol&gt;&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; InternetProtocol=boost::asio::ip::tcp 1&gt; ] </pre><p> Compile error in basic_io_object.hpp:45 at "service_has_move::eval(" </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#if defined(BOOST_ASIO_HAS_MOVE)</span> <span class="k">namespace</span> <span class="n">detail</span> <span class="p">{</span> <span class="c1">// Type trait used to determine whether a service supports move.</span> <span class="k">template</span> <span class="o">&lt;</span><span class="k">typename</span> <span class="n">IoObjectService</span><span class="o">&gt;</span> <span class="k">class</span> <span class="nc">service_has_move</span> <span class="p">{</span> <span class="k">private</span><span class="o">:</span> <span class="k">typedef</span> <span class="n">IoObjectService</span> <span class="n">service_type</span><span class="p">;</span> <span class="k">typedef</span> <span class="k">typename</span> <span class="n">service_type</span><span class="o">::</span><span class="n">implementation_type</span> <span class="n">implementation_type</span><span class="p">;</span> <span class="k">template</span> <span class="o">&lt;</span><span class="k">typename</span> <span class="n">T</span><span class="p">,</span> <span class="k">typename</span> <span class="n">U</span><span class="o">&gt;</span> <span class="k">static</span> <span class="k">auto</span> <span class="n">eval</span><span class="p">(</span><span class="n">T</span><span class="o">*</span> <span class="n">t</span><span class="p">,</span> <span class="n">U</span><span class="o">*</span> <span class="n">u</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="k">decltype</span><span class="p">(</span><span class="n">t</span><span class="o">-&gt;</span><span class="n">move_construct</span><span class="p">(</span><span class="o">*</span><span class="n">u</span><span class="p">,</span> <span class="o">*</span><span class="n">u</span><span class="p">),</span> <span class="kt">char</span><span class="p">());</span> <span class="k">static</span> <span class="nf">char</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">eval</span><span class="p">(...))[</span><span class="mi">2</span><span class="p">];</span> <span class="k">public</span><span class="o">:</span> <span class="k">static</span> <span class="k">const</span> <span class="kt">bool</span> <span class="n">value</span> <span class="o">=</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">service_has_move</span><span class="o">::</span><span class="n">eval</span><span class="p">(</span> <span class="k">static_cast</span><span class="o">&lt;</span><span class="n">service_type</span><span class="o">*&gt;</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span> <span class="k">static_cast</span><span class="o">&lt;</span><span class="n">implementation_type</span><span class="o">*&gt;</span><span class="p">(</span><span class="mi">0</span><span class="p">)))</span> <span class="o">==</span> <span class="mi">1</span><span class="p">;</span> <span class="p">};</span> <span class="p">}</span> <span class="cp">#endif </span><span class="c1">// defined(BOOST_ASIO_HAS_MOVE)</span> </pre></div></div> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12115 Trac 1.4.3 Sergey Svistunov <zenden2k@…> Wed, 06 Apr 2016 08:04:01 GMT <link>https://svn.boost.org/trac10/ticket/12115#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12115#comment:1</guid> <description> <p> Both in Update 1 and Update 2 this macro "BOOST_ASIO_HAS_MOVE" seems to be defined by boost.config. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 11 Apr 2016 02:05:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12115#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12115#comment:2</guid> <description> <p> I am encountering the same issue, also on VS2015 Update 2. This is preventing us from using Boost.Asio. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 11 Apr 2016 04:35:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12115#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12115#comment:3</guid> <description> <p> Also meet this error </p> </description> <category>Ticket</category> </item> <item> <author>article@…</author> <pubDate>Wed, 13 Apr 2016 03:40:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12115#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12115#comment:4</guid> <description> <p> I just encountering the same issue, and found a resolution: </p> <pre class="wiki">typedef asio::ip::tcp::resolver::iterator tcp_iterator; </pre><p> and use tcp_iterator, instead of use asio::ip::tcp::resolver::iterator direct in the constructors, and compile fine </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 14 Apr 2016 11:28:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12115#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12115#comment:5</guid> <description> <p> the solution I found was to just change this boost code (mentioned in the original report) </p> <pre class="wiki"> static const bool value = sizeof(service_has_move::eval( static_cast&lt;service_type*&gt;(0), static_cast&lt;implementation_type*&gt;(0))) == 1; </pre><p> to this </p> <p> </p> <pre class="wiki"> static const bool value = sizeof( eval( static_cast&lt;service_type*&gt;(0), static_cast&lt;implementation_type*&gt;(0))) == 1; </pre><p> (i.e. remove the service_has_move:: ) </p> <p> and it compiled fine. If you rename that actual method to something like eval2, you'll get a compile error, which confirms it's still resolving to the correct method. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 16 May 2016 03:57:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12115#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12115#comment:6</guid> <description> <p> Removing service_has_move worked for me! Thank you sir. </p> </description> <category>Ticket</category> </item> </channel> </rss>