Thread: [complement-svn] SF.net SVN: complement: [1574] trunk/complement/explore/inquiry
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2007-05-30 11:35:37
|
Revision: 1574 http://svn.sourceforge.net/complement/?rev=1574&view=rev Author: complement Date: 2007-05-30 04:35:35 -0700 (Wed, 30 May 2007) Log Message: ----------- what about of destructors order of auto objects? Added Paths: ----------- trunk/complement/explore/inquiry/AuTTL/ trunk/complement/explore/inquiry/AuTTL/Makefile trunk/complement/explore/inquiry/AuTTL/Makefile.inc trunk/complement/explore/inquiry/AuTTL/test.cc trunk/complement/explore/inquiry/AuTerm-order/ trunk/complement/explore/inquiry/AuTerm-order/Makefile trunk/complement/explore/inquiry/AuTerm-order/Makefile.inc trunk/complement/explore/inquiry/AuTerm-order/test.cc Property changes on: trunk/complement/explore/inquiry/AuTTL ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/inquiry/AuTTL/Makefile =================================================================== --- trunk/complement/explore/inquiry/AuTTL/Makefile (rev 0) +++ trunk/complement/explore/inquiry/AuTTL/Makefile 2007-05-30 11:35:35 UTC (rev 1574) @@ -0,0 +1,10 @@ +# -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr> + +SRCROOT := ../.. +COMPILER_NAME := gcc + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + +#CXXFLAGS += -fuse-cxa-atexit +# LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Added: trunk/complement/explore/inquiry/AuTTL/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/AuTTL/Makefile.inc (rev 0) +++ trunk/complement/explore/inquiry/AuTTL/Makefile.inc 2007-05-30 11:35:35 UTC (rev 1574) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr> + +PRGNAME = test +SRC_CC = test.cc Added: trunk/complement/explore/inquiry/AuTTL/test.cc =================================================================== --- trunk/complement/explore/inquiry/AuTTL/test.cc (rev 0) +++ trunk/complement/explore/inquiry/AuTTL/test.cc 2007-05-30 11:35:35 UTC (rev 1574) @@ -0,0 +1,69 @@ +#include <iostream> + +using namespace std; + +class Obj +{ + public: + + Obj( int _v ) : + v( _v ) + { cerr << "Obj(" << v << ")" << endl; } + + Obj& operator=( const Obj& o ) + { cerr << "=(" << o.v << ")" << endl; /* v = o.v; */ } + + Obj( const Obj& o ) + { v = o.v; cerr << "O(Obj" << o.v << ")" << endl; } + + ~Obj() + { cerr << "~Obj(" << v << ")" << endl; } + + int v; +}; + +Obj f() +{ + Obj v(1); + const Obj& v2 = v; + + return v2; +} + +const Obj& g() // ill-formed! +{ + Obj v(2); + const Obj& v3 = v; // <--- + + return v3; // <--- +} + +Obj h() +{ + Obj v(4); + Obj v2(5); + + return v2; +} + +int main() +{ + { + Obj v0( 0 ); + + v0 = f(); + } + { + Obj v1( 3 ); + + v1 = g(); + } + { + Obj v2( 6 ); + + v2 = h(); + } + + return 0; +} + Property changes on: trunk/complement/explore/inquiry/AuTerm-order ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/inquiry/AuTerm-order/Makefile =================================================================== --- trunk/complement/explore/inquiry/AuTerm-order/Makefile (rev 0) +++ trunk/complement/explore/inquiry/AuTerm-order/Makefile 2007-05-30 11:35:35 UTC (rev 1574) @@ -0,0 +1,10 @@ +# -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr> + +SRCROOT := ../.. +COMPILER_NAME := gcc + +include Makefile.inc +include ${SRCROOT}/Makefiles/top.mak + +#CXXFLAGS += -fuse-cxa-atexit +# LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Added: trunk/complement/explore/inquiry/AuTerm-order/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/AuTerm-order/Makefile.inc (rev 0) +++ trunk/complement/explore/inquiry/AuTerm-order/Makefile.inc 2007-05-30 11:35:35 UTC (rev 1574) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr> + +PRGNAME = test +SRC_CC = test.cc Added: trunk/complement/explore/inquiry/AuTerm-order/test.cc =================================================================== --- trunk/complement/explore/inquiry/AuTerm-order/test.cc (rev 0) +++ trunk/complement/explore/inquiry/AuTerm-order/test.cc 2007-05-30 11:35:35 UTC (rev 1574) @@ -0,0 +1,44 @@ +#include <iostream> + +using namespace std; + +class Obj +{ + public: + + Obj( int _v ) : + v( _v ) + { cerr << "Obj(" << v << ")" << endl; } + + Obj& operator=( const Obj& o ) + { v = o.v; cerr << "=(" << o.v << ")" << endl; } + + Obj( const Obj& o ) + { v = o.v; cerr << "O(Obj" << o.v << ")" << endl; } + + ~Obj() + { cerr << "~Obj(" << v << ")" << endl; } + + int v; + static int q; +}; + +int Obj::q; + +Obj f() +{ + Obj v1(1); + Obj v2(2); + + return v2; +} + +int main() +{ + Obj v0( 0 ); + + v0 = f(); + + return 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-11-21 11:56:09
|
Revision: 1791 http://complement.svn.sourceforge.net/complement/?rev=1791&view=rev Author: complement Date: 2007-11-21 03:56:06 -0800 (Wed, 21 Nov 2007) Log Message: ----------- what printed as address of member function? Added Paths: ----------- trunk/complement/explore/inquiry/memfun/ trunk/complement/explore/inquiry/memfun/Makefile trunk/complement/explore/inquiry/memfun/Makefile.inc trunk/complement/explore/inquiry/memfun/test.cc Property changes on: trunk/complement/explore/inquiry/memfun ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/inquiry/memfun/Makefile =================================================================== --- trunk/complement/explore/inquiry/memfun/Makefile (rev 0) +++ trunk/complement/explore/inquiry/memfun/Makefile 2007-11-21 11:56:06 UTC (rev 1791) @@ -0,0 +1,12 @@ +# -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr> +# $Id: Makefile 1599 2007-07-04 10:47:43Z complement $ + +SRCROOT := ../.. +COMPILER_NAME := gcc + +STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport +include Makefile.inc +include ${SRCROOT}/Makefiles/gmake/top.mak + +#CXXFLAGS += -fuse-cxa-atexit +LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Added: trunk/complement/explore/inquiry/memfun/Makefile.inc =================================================================== --- trunk/complement/explore/inquiry/memfun/Makefile.inc (rev 0) +++ trunk/complement/explore/inquiry/memfun/Makefile.inc 2007-11-21 11:56:06 UTC (rev 1791) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr> + +PRGNAME = test +SRC_CC = test.cc Added: trunk/complement/explore/inquiry/memfun/test.cc =================================================================== --- trunk/complement/explore/inquiry/memfun/test.cc (rev 0) +++ trunk/complement/explore/inquiry/memfun/test.cc 2007-11-21 11:56:06 UTC (rev 1791) @@ -0,0 +1,44 @@ +#include <string> +#include <iostream> + +using namespace std; + +class A +{ + public: + bool a(); + bool b(); + bool c(); +}; + +bool A::a() +{ + cerr << "A::a" << endl; + return true; +} + +bool A::b() +{ + cerr << "A::b" << endl; + return true; +} + +bool A::c() +{ + cerr << "A::c" << endl; + return true; +} + +int main() +{ + cerr << &A::a << " " << &A::b << " " << &A::c << endl; + + A x; + + bool (A::*mem)() = &A::b; + + (x.*mem)(); + // cerr << &x.a << " " << &x.b << " " << &x.c << endl; + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |