Patrick Hartling wrote:
> A problem has arisen with CppDOM on Win32, most likely because of the
> change I made for the import/export stuff for the CppDOM DLL. It has
> come to my attention that cppdom::Attributes derives from std::map<>.
> (More specifically, it derives from std::map<std::string, std::string>).
>
> If there is code that links against CppDOM that also uses the type
> std::map<std::string, std::string>, the VC++ 7 linker complains of
> multiply defined symbols, all of them in the std::map<> class. It is my
> understanding that deriving from STL types is not recommended, and in my
> (limited) experience, DLLs and templates as base types do not mix well.
>
> So, my proposed change is to fix cppdom::Attributes so that it
> aggregates std::map<std::string, std::string> instead of extending it.
> The API for cppdom::Attributes has to be extended a little to have some
> pass-through methods into the std::map<> interface. I have already made
> this change and tested it successfully, and I want to know if it is okay
> to commit it. I'm sure my changes aren't very elegant, but they get the
> job done.
I like the idea.
It would also allow us to internally use a hash_map when the platform
supports it.
-Allen
> -Patrick
>
>
--
-- Allen Bierbaum al...@vr...
-- PhD Candidate txtmsg - 515...@us...
-- VR Juggler Team www.vrjuggler.org
-- Virtual Reality Applications Center www.vrac.iastate.edu
|