boost::asio::read_until w/ boost::function
I'm having some trouble resolving the call to read_until
(see snippet below)
Is there some reason I am not be able to use a boost::function
as the MatchCondition object?
Thanks,
...m
_______________
[MyClass.h]
class MyClass {
...
typedef
boost::asio::buffers_iteratorboost::asio::streambuf::const_buffers_type
t_Iterator;
typedef std::pair
On Sat, Feb 20, 2010 at 10:56 AM, Igor R
I'm having some trouble resolving the call to read_until (see snippet below)
Is there some reason I am not be able to use a boost::function as the MatchCondition object?
It compiles well with MSVC9.0
As a workaround, try assigning the result of the bind to a boost::function<> object of the appropriate type first, and then passing that boost::function<> object by value into the asio method Not sure if it will work, but if nothing else it might get the compiler to give you a different error and you can figure something out.
Thanks for your input. Unfortunately; no dice. It still doesn't
compile (below), and the error(also below) provides little insight in my
relatively inexperienced assessment. I have a feeling that the
enable_if mechanism is not behaving properly on my particular system.
(the fact that others have successfully compiled this implies that the
boost::function must have the correct signature to satisfy the
enable_if....)
----error
/usr/local/include/boost/asio/read_until.hpp: In instantiation of
`boost::asio::detail::has_result_type
On Sat, Feb 20, 2010 at 10:56 AM, Igor R
mailto:boost.lists@gmail.com> wrote: > I'm having some trouble resolving the call to read_until > (see snippet below) > > Is there some reason I am not be able to use a boost::function > as the MatchCondition object?
It compiles well with MSVC9.0
As a workaround, try assigning the result of the bind to a boost::function<> object of the appropriate type first, and then passing that boost::function<> object by value into the asio method
Not sure if it will work, but if nothing else it might get the compiler to give you a different error and you can figure something out.
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
AMDG marty wrote:
Thanks for your input. Unfortunately; no dice. It still doesn't compile (below), and the error(also below) provides little insight in my relatively inexperienced assessment. I have a feeling that the enable_if mechanism is not behaving properly on my particular system.
It isn't the enable_if per se that is causing the problem. is_match_condition doesn't seem to work properly.
(the fact that others have successfully compiled this implies that the boost::function must have the correct signature to satisfy the enable_if....)
----error
/usr/local/include/boost/asio/read_until.hpp:60: error: enumerator value for `value' not integer constant ../src/temp.cpp: In constructor `MyClass::MyClass()':
The compiler doesn't seem to like the implementation of has_result_type here.
I'm following up my original post with some actual code an interested person might try to compile, as well as the specific errors I'm getting. boost 1.41.0, gcc 3.4.6 Can you use a more recent compiler?
It also /might/ work if you replace has_result_type with
BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
and add #include
participants (4)
-
Igor R
-
marty
-
Steven Watanabe
-
Zachary Turner