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 <[EMAIL PROTECTED]>

        * 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)


Reply via email to