Я хочу сохранить объекты бустер-сигналов на карте (ассоциация: имя сигнала → объект сигнала). Сигнатура сигналов отличается, поэтому второй тип карты должен быть boost :: any .
map<string, any> mSignalAssociation;
Вопрос в том, как хранить объекты без определения типа новой сигнатуры сигнала?
typedef boost::signals2::signal<void (int KeyCode)> sigKeyPressed;
mSignalAssociation.insert(make_pair("KeyPressed", sigKeyPressed()));
// This is what I need: passing object without type definition
mSignalAssociation["KeyPressed"] = (typename boost::signals2::signal<void (int KeyCode)>());
// One more trying which won't work. And I don't want use this
sigKeyPressed mKeyPressed;
mSignalAssociation["KeyPressed"] = mKeyPressed;
Все эти попытки выдают ошибку:
/usr/include/boost/noncopyable.hpp: In copy constructor ‘boost::signals2::signal_base::signal_base(const boost::signals2::signal_base&)’:
In file included from /usr/include/boost/signals2/detail/signals_common.hpp:17:0,
/usr/include/boost/noncopyable.hpp:27:7: error: ‘boost::noncopyable_::noncopyable::noncopyable(const boost::noncopyable_::noncopyable&)’ is private
/usr/include/boost/signals2/signal_base.hpp:22:5: error: within this context
----------
/usr/include/boost/signals2/detail/signal_template.hpp: In copy constructor ‘boost::signals2::signal1<void, int&, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>::signal1(const boost::signals2::signal1<void, int, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>&)’:
In file included from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:0,
/usr/include/boost/signals2/detail/signal_template.hpp:578:5: note: synthesized method ‘boost::signals2::signal_base::signal_base(const boost::signals2::signal_base&)’ first required here
from /usr/include/boost/signals2.hpp:16,
---------
/usr/include/boost/signals2/preprocessed_signal.hpp: In copy constructor ‘boost::signals2::signal<void(int)>::signal(const boost::signals2::signal<void(int)>&)’:
In file included from /usr/include/boost/signals2/signal.hpp:36:0,
/usr/include/boost/signals2/preprocessed_signal.hpp:42:5: note: synthesized method ‘boost::signals2::signal1<void, int, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>::signal1(const boost::signals2::signal1<void, int, boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void(int)>, boost::function<void(const boost::signals2::connection&, int)>, boost::signals2::mutex>&)’ first required here
from /home/ockonal/Workspace/Projects/Pseudoform-2/include/Core/Systems.hpp:6,