stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r567733 - /incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp
Date Mon, 20 Aug 2007 15:57:00 GMT
Author: faridz
Date: Mon Aug 20 08:56:59 2007
New Revision: 567733

URL: http://svn.apache.org/viewvc?rev=567733&view=rev
Log:
2007-08-20 Farid Zaripov <Farid_Zaripov@epam.com>

	* dynatype.cpp (copy): applied again changes in r544831 with
	adding comment in source file (the changes prevents error
	"invalid static_cast from type `const dynatype' to type `int'"
	on gcc 3.4.4/Cygwin).

Modified:
    incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp

Modified: incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp?rev=567733&r1=567732&r2=567733&view=diff
==============================================================================
--- incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp (original)
+++ incubator/stdcxx/trunk/examples/tutorial/dynatype.cpp Mon Aug 20 08:56:59 2007
@@ -55,7 +55,9 @@
     // helper: copies one instance of dynatype to another
     template <class T>
     void copy (const dynatype &rhs) {
-        *this = static_cast<T>(rhs);
+        // cast to <const T&> instead of <T> to avoid error on gcc 3.4.4/cygwin:
+        // error: invalid static_cast from type `const dynatype' to type `int'
+        *this = static_cast<const T&>(rhs);
     }
 
     // pointers to the helpers (do not depend on a template parameter)



Mime
View raw message