map<string, factory<BaseClass, ConstructorType> >
そのような機能からどのように受け取るのですか?
ので、私は持っています
template <class BaseClass, class ConstructorType>
map<string, factory<BaseClass, ConstructorType> > get_factories (shared_library & lib) {
type_map lib_types;
if (!lib.call(lib_types)) {
cerr << "Types map not found!" << endl;
}
map<string, factory<BaseClass, ConstructorType> >& lib_factories(lib_types.get());
if (lib_factories.empty()) {
cerr << "Producers not found!" << endl;
}
return lib_factories;
}
そして、私は次のようなものでその値を取得しようとします:
map<string, factory<PublicProducerPrototype, int> > producer_factories();
producer_factories = get_factories<PublicProducerPrototype, int>(simple_producer);
私は自分自身のために、boost.extension メソッドのいくつかを一般化/単純化しようとしています。
map<A, B>&
では、正しく受け取るには?
リンクを正しく初期化する方法、またはリンクではなく実際のオブジェクトを返す方法は? (申し訳ありません C++ ヌーブ)