The Grimoire of Nonsense

個人的なメモを残すブログ

STLをDLL化するっ

ヘッダにこんな感じで書くといい。

#pragma once

#pragma warning( push )
#pragma warning( disable: 4231 4251 )

#if defined( _WINDLL )
	#define EXPORT __declspec( dllexport )
#else
	#define EXPORT __declspec( dllimport )
#endif

#include <vector>

template class EXPORT std::vector<int>;	// intとか色々書こう

#pragma warning( pop )
#undef EXPORT