[David, haven't seen your posting, so I
don't know if you wrote anything else
which I missed.]
That's funny.
I tried it again: Copy & paste the code
from Bronek's original posting int a my
test project, compile it, and get this:
------ Build started: Project: Test, Configuration: Debug Win32 ------
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
cl /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MLd /GS /Za /Zc:wchar_t /Zc:forScope /GR
/Fo"C:\Temp\Test\Debug\Test/" /Fd"C:\Temp\Test\Debug\Test/vc70.pdb" /W4 /c /Wp64 /Zi /TP
\Develop\test.cpp
test.cpp
\Develop\test.cpp(22) : error C2664: 'std::auto_ptr<_Ty>::auto_ptr(std::auto_ptr<_Ty> &) throw()' : cannot convert parameter 1
from 'std::auto_ptr<_Ty>' to 'std::auto_ptr<_Ty> &'
with
[
_Ty=A
]
and
[
_Ty=A
]
and
[
_Ty=A
]
A reference that is not to 'const' cannot be bound to a non-lvalue
[Damn, I hate the IDE trying to copy formatted text
to the clipboard! OE is just to stupid to deal with
it. Can I have a switch to turn this off, please?!]
My "yvals.h" file has a
#define _CPPLIB_VER 313
in it.
Yeah:
Comeau C/C++ 4.3.3 (Aug 6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:strict errors C++
"ComeauTest.c", line 18: error: extra ";" ignored,
In C: A function definition does not end with a semicolon
In C++: A function definition, extern "C" or namespace, does not end with a semicolon
};
^
"ComeauTest.c", line 22: error: class "std::auto_ptr<A>" has no suitable copy
constructor
auto_ptr<A> r = test();
^
2 errors detected in the compilation of "ComeauTest.c".
For Comeau I know. I was using this:
Comeau C/C++ 4.3.3 (Aug 10 2003 15:39:53) for _MS_WINDOWS_x86_Beta8
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:non-strict warnings microsoft C++
That's what I have on disk, and I think it's
using VC's std lib. AFAIK, Comeau Online uses
libcomo, which is a derivate of SGI's std lib.
Maybe that question should be passed to Mr. Plauger ?
This might be true for the difference between
Comeau Online and my version, which does use
Plauger's std lib. (You might want to post
your question in the STL group. Or go and ask
on comp.lang.c++.moderated ot comp.std.c++.)
However, I am still puzzled why David gets
different results with VC.
Schobi
--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org
"Sometimes compilers are so much more reasonable than people."
Scott Meyers