[ptr_container] Dereferencing boost::signals2::signal from ptr_map
Hi, I got a huge problem with a boost::ptr_map. I am storing instances of boost::signals2::signal in it and try to dereference a iterator to one of those instances, to be able to call the operator () of the signal. This compiles correctly on Linux and gcc 4.4 but fails on Windows using Visual C++ 2008. The ptr_map is of type: typedef boost::ptr_map <std::string, boost::signals2::signal <void (Event)> > EventMap; And what i am trying to do is this: EventMap::iterator it = mEvents.find (event); if (it == mEvents.end ()) EXCEPTION ("Event doesn't exist"); (*it->second) (evt); The error message on Windows: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include \xutility(419) : error C2664: 'boost::signals2::detail::stack_allocator<T,n_stack_elements>::stack_allocator(boost::signals2::detail::stack_storage<T,10> *)': Konvertierung des Parameters 1 von 'boost::signals2::detail::stack_allocator<T,n_stack_elements>' in 'boost::signals2::detail::stack_storage<T,n_stack_elements> *' nicht möglich with [ T=std::_Aux_cont, n_stack_elements=10 ] and [ T=boost::shared_ptr<void>, n_stack_elements=10 ] and [ T=std::_Aux_cont, n_stack_elements=10 ] (First line translated is: Conversion of the first parameter from ... to .. not possible). For the complete code see http://github.com/rmbl/openspeak/raw/487dfcbea24df79216171f37d3102f8e76c8f78... and http://github.com/rmbl/openspeak/raw/487dfcbea24df79216171f37d3102f8e76c8f78... Thanks for any help. Regards Philipp Gildein
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 10 September 2009, Philipp Gildein wrote:
Hi,
I got a huge problem with a boost::ptr_map. I am storing instances of boost::signals2::signal in it and try to dereference a iterator to one of those instances, to be able to call the operator () of the signal. This compiles correctly on Linux and gcc 4.4 but fails on Windows using Visual C++ 2008.
I believe you are hitting this problem: http://lists.boost.org/boost-users/2009/04/47572.php It should be fixed in 1.40, or you could apply the changeset 52627 to your version of boost. You can also work around it by turning off iterator checking. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqqdewACgkQ5vihyNWuA4UggwCfR+YgQNLcFe3jwaujalwDy2XO N8YAn3vgPirAChLGvba63O3AML3Di8fc =+L/0 -----END PGP SIGNATURE-----
Thanks alot. Works perfectly with Boost 1.40 Am Freitag, den 11.09.2009, 12:08 -0400 schrieb Frank Mori Hess:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thursday 10 September 2009, Philipp Gildein wrote:
Hi,
I got a huge problem with a boost::ptr_map. I am storing instances of boost::signals2::signal in it and try to dereference a iterator to one of those instances, to be able to call the operator () of the signal. This compiles correctly on Linux and gcc 4.4 but fails on Windows using Visual C++ 2008.
I believe you are hitting this problem:
http://lists.boost.org/boost-users/2009/04/47572.php
It should be fixed in 1.40, or you could apply the changeset 52627 to your version of boost. You can also work around it by turning off iterator checking.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkqqdewACgkQ5vihyNWuA4UggwCfR+YgQNLcFe3jwaujalwDy2XO N8YAn3vgPirAChLGvba63O3AML3Di8fc =+L/0 -----END PGP SIGNATURE----- _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Frank Mori Hess
-
Philipp Gildein