M
Mark Buxbaum
Hi,
Is is possible to use a collection class instance as a helper object in a class?
For example:
MyClass.h:
----------
class MyClass
{
map<string, string> m_mapMyMap;
};
MyClass.cpp:
------------
#include "stdafx.h"
#include <string>
#include <map>
using namespace std;
#include "MyClass.h"
------------
Visual Studio .NET 2003 says:
"syntax error: missing ';' before '<' in MyClass.h
Moving the definition of m_mapMyMap into MyClass.cpp compiles fine.
However, it would be nice to be able to use these collection classes
as private data members within an owning class
(as I believe is possible with Java and C#, which do not have similar
template functionality).
Thanks for any info,
Mark
Is is possible to use a collection class instance as a helper object in a class?
For example:
MyClass.h:
----------
class MyClass
{
map<string, string> m_mapMyMap;
};
MyClass.cpp:
------------
#include "stdafx.h"
#include <string>
#include <map>
using namespace std;
#include "MyClass.h"
------------
Visual Studio .NET 2003 says:
"syntax error: missing ';' before '<' in MyClass.h
Moving the definition of m_mapMyMap into MyClass.cpp compiles fine.
However, it would be nice to be able to use these collection classes
as private data members within an owning class
(as I believe is possible with Java and C#, which do not have similar
template functionality).
Thanks for any info,
Mark