Subject: [Boost-bugs] [Boost C++ Libraries] #5781: Inclusion of boost.asio header ahead of boost.function header causes syntax error with MSVC
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-13 22:39:28
#5781: Inclusion of boost.asio header ahead of boost.function header causes syntax
error with MSVC
---------------------------------------------------+------------------------
Reporter: Colin Irwin <colin.a.irwin@â¦> | Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.47.0 | Severity: Problem
Keywords: |
---------------------------------------------------+------------------------
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.
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.
The compiler version I'm using is MS Visual Studio 2008, Version
9.0.21022.8 RTM.
I looked for an already submitted bug per the instructions, but couldn't
find anything immediately obvious.
Minimal code example is:
#include <boost/asio.hpp>
#include <boost/function.hpp>
typedef boost::function< void ( const int ) > ConsumerCallback;
void registerConsumer( ConsumerCallback const& CALLBACK );
Error generated from this:
1>Compiling...
1>python_bspl_radio.cpp
1>..\source\python\python_bspl_radio.cpp(16) : error C2059: syntax error :
')'
1>..\source\python\python_bspl_radio.cpp(16) : error C2143: syntax error :
missing ')' before ';'
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5781> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC