Boost logo

Boost Users :

Subject: [Boost-users] [ptr_container] Dereferencing boost::signals2::signal from ptr_map
From: Philipp Gildein (rmbl_at_[hidden])
Date: 2009-09-10 10:26:44


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/487dfcbea24df79216171f37d3102f8e76c8f780/clientlib/include/EventMgr.hpp and http://github.com/rmbl/openspeak/raw/487dfcbea24df79216171f37d3102f8e76c8f780/clientlib/src/EventMgr.cpp

Thanks for any help. Regards
Philipp Gildein


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