Boost C++ Libraries: Ticket #5781: Inclusion of boost.asio header ahead of boost.function header causes syntax error with MSVC https://svn.boost.org/trac10/ticket/5781 <p> The inclusion of the asio header file ahead of the function header file causes problems with MSVC9. No asio header file and everything works as expected. </p> <p> This seems to be related to passing the boost.function object either by reference or const reference. Passing it by value results in no warnings/errors. In all cases - value, reference, const reference - if the asio header is not included, then everything is fine. </p> <p> The compiler version I'm using is MS Visual Studio 2008, Version 9.0.21022.8 RTM. </p> <p> I looked for an already submitted bug per the instructions, but couldn't find anything immediately obvious. </p> <p> Minimal code example is: </p> <p> #include &lt;boost/asio.hpp&gt; #include &lt;boost/function.hpp&gt; </p> <p> typedef boost::function&lt; void ( const int ) &gt; <a class="missing wiki">ConsumerCallback</a>; void registerConsumer( <a class="missing wiki">ConsumerCallback</a> const&amp; CALLBACK ); </p> <p> Error generated from this: </p> <p> 1&gt;Compiling... 1&gt;python_bspl_radio.cpp 1&gt;..\source\python\python_bspl_radio.cpp(16) : error C2059: syntax error : ')' 1&gt;..\source\python\python_bspl_radio.cpp(16) : error C2143: syntax error : missing ')' before ';' </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5781 Trac 1.4.3 chris_kohlhoff Tue, 29 May 2012 01:57:35 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5781#comment:1 https://svn.boost.org/trac10/ticket/5781#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Don't name your parameter <code>CALLBACK</code>. This is a macro defined by the Windows SDK headers. </p> Ticket