The following code fails to compile in MSVStudio 2010 Express, and seems to be because the boost container declaration creates a (static?) instance of the contained type. Changing boost::ptr_list<TypeContained>
to std::list<TypeContained *>
causes it to compile successfully, but I like the the boost containers. Anyone have an idea how I can get around this? The error is 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;
}