如何从函数/类接收map &
|
如何从这样的功能接收“ 0”?
所以我有
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方法。
那么如何正确接收receive3ѭ呢?
如何正确初始化链接或如何不返回链接而是返回真实对象? (对不起,C ++ nube)
没有找到相关结果
已邀请:
1 个回复
可扇胆
当然,这假定由
返回的参考可以安全地作为参考传递出去。