0
OgrePrerequisites.hOgre如何在沒有C4251警告的導出類中使用STL容器?
#define _OgreExport __declspec(dllexport)
template <typename K, typename V, typename P = std::less<K>, typename A = STLAllocator<std::pair<const K, V>, GeneralAllocPolicy> >
struct map
{
typedef typename std::map<K, V, P, A> type;
typedef typename std::map<K, V, P, A>::iterator iterator;
typedef typename std::map<K, V, P, A>::const_iterator const_iterator;
}
OgreLogManager.h
class _OgreExport LogManager
{
protected:
typedef map<String, Log*>::type LogList;
/// A list of all the logs the manager can access
LogList mLogs;
};
的LogManager
使用std::map
,但是當我建立這個項目,我沒有得到任何警告C4251:
**class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients of class**
我想要了解Ogre如何消除C4251
警告?