Is it a bug (gcc 3.4)?
Lev Assinovsky
LAssinovsky@algorithm.aelita.com
Tue Jun 8 11:36:00 GMT 2004
Hi all!
With auto_ptr from gcc 3.4 STL I can't create reference to auto_ptr.
autoptr.cpp:
#include <memory>
using namespace std;
auto_ptr<int> get() { auto_ptr<int> ai(new int); return ai;}
int main()
{
const auto_ptr<int>& rai = get();
}
Compilation:
/expor...ic_refer$>g++ -c autoptr.cpp
autoptr.cpp: In function `int main()':
autoptr.cpp:7: error: passing `const std::auto_ptr<int>' as `this' argument of `std::auto_ptr<_Tp>::operator std::auto_ptr_ref<_Tp1>()
[with _Tp1 = int, _Tp = int]' discards qualifiers
Is it a bug?
It used to work with gcc 3.2.
----
Lev Assinovsky
Aelita Software Corporation
(now is a part of Quest Software)
O&S InTrust Framework Division, Team Leader
ICQ# 165072909
More information about the Gcc-help
mailing list