次のコードは、MSVStudio 2010 Express でのコンパイルに失敗します。これは、boost コンテナー宣言が含まれている型の (静的?) インスタンスを作成するためと思われます。に変更boost::ptr_list<TypeContained>
するstd::list<TypeContained *>
と正常にコンパイルされますが、boost コンテナーが気に入っています。これを回避する方法を知っている人はいますか? エラーはerror C2504: 'Proxy<TypeContainer,TypeContained>' : base class undefined
#include <string>
#include <boost/ptr_container/ptr_list.hpp>
template <typename TypeContainer, typename TypeContained>
class Proxy
{
private:
typename boost::ptr_list<TypeContained>::iterator m_clsPosition;
public:
class Container {};
};
template <typename V> class Container;
template <typename V>
class Dependent : public Proxy<Container<V>, Dependent<V> >,
public V {};
template <typename V>
class Container : public Proxy<Container<V>, Dependent<V> >::Container {};
int main(int argc, char * argv[])
{
Container<std::string> clsContainer;
return 0;
}