From: Brian D. <sea...@ho...> - 2002-11-05 08:20:45
|
Hey everyone, congrats on the new install process for 2.0.0 - quite slick. Also glad to see vtable thunking is on by default. Looks like MINGW is poised to insinuate itself onto a lot of development desktops! In any case, I'm trying to compile a program that does o.k. with MS Visual Studio .NET, but chokes on some usages of auto_ptr in MINGW. I've researched it a bit, but I know so little about smart pointers that I can't hardly make heads or tails of the guru debates about the various versions of std::auto_ptr and their quirks! What it seems to come down to is that using the install from 2.0.0 I get errors that look like: foo.cpp:200: no matching function for call to `std::auto_ptr<MODBASE>::auto_ptr(std::auto_ptr<MODBASE>)' D:/DEV/MINGW/include/c++/3.2/memory:346: candidates are: std::auto_ptr<_Tp>::auto_ptr(std::auto_ptr_ref<_Tp>) [with _Tp = MODBASE] D:/DEV/MINGW/include/c++/3.2/memory:216: std::auto_ptr<_Tp>::auto_ptr(std::auto_ptr<_Tp1>&) [with _Tp1 = MODBASE, _Tp = MODBASE] D:/DEV/MINGW/include/c++/3.2/memory:203: std::auto_ptr<_Tp>::auto_ptr(std::auto_ptr<_Tp>&) [with _Tp = MODBASE] This results from a piece of source that looks like: 199: P<MOD<DOC_MUSIC> > pmodCreate (new DOC_MUSIC::MOD_CREATE()); 200: pdoc->ApplyMod(pmodCreate); The prototype for ApplyMod looks like: void DOC::ApplyMod(std::auto_ptr<MODBASE> pmod); My intention is to pass ownership of the "MOD" object to the document (and MOD<xxx> is just a way of generating a class derived from MODBASE). All seems to work fine if I don't use a derived class auto_ptr: 199: P<MODBASE> pmodCreate (new DOC_MUSIC::MOD_CREATE()); 200: pdoc->ApplyMod(pmodCreate); As it happens, though, I'm trying to discourage explicit use of MODBASE in this particular body of code. Does anyone understand the issues here well enough to tell me what might be going wrong, and why this conversion would work in MSVC and not in MINGW? Any way to make it work? Many thanks! ---Brian _________________________________________________________________ Unlimited Internet access for only $21.95/month. Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp |