Boost logo

Boost Users :

Subject: Re: [Boost-users] [Coroutine] Assertion when coroutine is not run
From: Brian Ravnsgaard Riis (brian_at_[hidden])
Date: 2014-03-11 01:30:30


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2014-03-10 13:03, Brian Ravnsgaard Riis wrote:
> I can of course merge the two coroutines without problems, which
> will be fine for my use-cases. However, I fail to understand why I
> get the assertion at all, when I don't call the coroutine. Some
> basic mechanics I haven't quite caught yet, I guess.

Hi,

I'm now working around the problem by just not initialising the two
push_type members. Then in the two parse*-functions I initialise when
needed, using normal private member functions:

if(!headerParser_)
{
    boost::coroutines::coroutine<char>::push_type
    {
        std::bind(&Parser::doParseHeader, this, std::placeholders::_1)
    }.swap(headerParser_);
}

This works fine, and is fine with me too(!) really. I'm still not sure
why it's necessary, though...

 /Brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTHp92AAoJEFES4N8QrEodmmsIAJ7MdJd5khbLjwnoQliBRXYU
eG8f6EbiePY7VU0Bn30J+ZsYlJ29qNq17nHMLvm7GukNFqPPuzsG8QtAC697vyxg
3mWwkvZtIrR0dTzT6i1+z1fAEqZSZfVFrU2cv7o5jCb2A3GBpPk8aL5v0VuFEDRq
+PEjA9Un7W0aQhujt77Undtguu0p8g7pgeKTFANfsgf1IQY9+PiSLo7/REtRRr0S
twLoM1MDb89b4OBc8ZgoagpJtSwbLBXKHIqlCBoOkAuBLj1KTnfeEb3bcimhrP+1
CtOgESCMcbalW6oXP1eqTpfnoRiSC+RZ5E2Q/ET+jRAHAQ4pwgnF6j4yYa0UmIg=
=nqdf
-----END PGP SIGNATURE-----


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net