2013/3/27 Lukas Czaja <lukas70000@gmail.com>:
Hi, i was checking if my code is compatible with c++98 standard and i've encounterd compile error. With -std c++11 option everything works fine. Below i've written code causing same problem.
#include <boost/coroutine/coroutine.hpp> #include <boost/coroutine/attributes.hpp>
typedef boost::coroutines::coroutine<void( boost::system::error_code , std::size_t)> coro_t;
struct coro_test{
coro_test() {}
void coro_fun(typename coro_t::caller_type& ca)const{ boost::system::error_code ec; boost::tie(ec, boost::tuples::ignore) = ca.get(); ca(); }
coro_t coro; };
int main(int argc, char *argv[]) {
{ boost::system::error_code ec; coro_t coro2; //default construction is ok coro_test ctest; //compile error , why ??? coro_t coro( boost::bind(&coro_test::coro_fun, &ctest, _1),coro_t::arguments( ec, 7)); coro = coro_t(boost::bind(&coro_test::coro_fun, &ctest, _1),coro_t::arguments( ec, 7)); } ...
/usr/local/include/boost/type_traits/is_function.hpp:50: błąd:forming pointer to reference type 'boost::rv<boost::coroutines::coroutine<void(boost::system::error_code, long unsigned int)> >&'
/usr/local/include/boost/type_traits/is_function.hpp:102: błąd:'value' is not a member of 'boost::detail::is_function_impl<boost::rv<boost::coroutines::coroutine<void(boost::system::error_code, long unsigned int)> >&>'
/usr/local/include/boost/type_traits/is_convertible.hpp:354: błąd:'value' is not a member of 'boost::is_function<boost::rv<boost::coroutines::coroutine<void(boost::system::error_code, long unsigned int)> >&>'
/usr/local/include/boost/utility/enable_if.hpp:59: błąd:'value' is not a member of 'boost::is_convertible<boost::coroutines::coroutine<void(boost::system::error_code, long unsigned int)>&, boost::rv<boost::coroutines::coroutine<void(boost::system::error_code, long unsigned int)> >&>'
I work with Qt, g++ compiler on ubuntu 12.10 Is this library bug ?
There is bug in code. Problem is caused by generated default copy constructor. I checked inherit boost::noncopyable before which cause same errors, and I thought copy constructor is not a case. Sorry for that