Mail Archives: cygwin/1999/04/22/18:06:53
On Thu, 22 Apr 1999 ioconnor AT Siac DOT COM wrote:
> I downloaded full.exe from the latest directory and attempted to compile a
> program that uses <auto_ptr>. Unfortunately it didn't work.
>
> How does one go about getting a working version of gcc which can handle
> <auto_ptr>? (Does it exist?!)
before getting down to auto_ptr<> details,
- the c++ compiler distributed with full.exe is quite old by now, and
there've been 2 releases since then. I suggest you pick up a copy of
egcs-1.1.2 (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/).
- EGCS releases to date use the older SGI STL that didn't include an
compliant version of auto_ptr, and had it commented out in memory.h.
This is the case for egcs-1.1.2 as well; the next major release of
egcs, 1.2, will have the latest SGI STL, with auto_ptr and all.
To use auto_ptr (after downloading egcs-1.1.2 of course), you can do one
of two things:
1. Re-enable the auto_ptr in the STL distributed with egcs-1.1.2. You can
use the following trivial patch. The patch assumes source distribution,
but you can just as easily apply to the installed copy as well.
Thu Mar 15 22:01:16 1999 Mumit Khan <khan AT xraylith DOT wisc DOT edu>
* stl/memory.h (auto_ptr): Enable for egcs-1.1.2 and fix const
bug in release().
--- stl/memory Mon Mar 15 12:12:08 1999
+++ stl/memory Mon Apr 15 21:46:55 1999
@@ -26,8 +26,8 @@
// of the interface are still being discussed by the C++ standardization
// committee. It will be included once the iterface is finalized.
-#if 0
-#if defined(_MUTABLE_IS_KEYWORD) && defined(_EXPLICIT_IS_KEYWORD) && \
+#if 1
+#if 1 || defined(_MUTABLE_IS_KEYWORD) && defined(_EXPLICIT_IS_KEYWORD) && \
defined(__STL_MEMBER_TEMPLATES)
__STL_BEGIN_NAMESPACE
@@ -73,7 +73,7 @@ public:
X& operator*() const __STL_NOTHROW { return *ptr; }
X* operator->() const __STL_NOTHROW { return ptr; }
X* get() const __STL_NOTHROW { return ptr; }
- X* release const __STL_NOTHROW { owns = false; return ptr }
+ X* release () __STL_NOTHROW { owns = false; return ptr; }
};
__STL_END_NAMESPACE
2. Or, get the latest SGI STL and use it with egcs-1.1.2.
Regards,
Mumit
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -