Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66368 - trunk/libs/proto/example
From: eric_at_[hidden]
Date: 2010-11-02 18:27:23


Author: eric_niebler
Date: 2010-11-02 18:27:22 EDT (Tue, 02 Nov 2010)
New Revision: 66368
URL: http://svn.boost.org/trac/boost/changeset/66368

Log:
add non-template copy-assign operator
Text files modified:
   trunk/libs/proto/example/vec3.cpp | 10 ++++++++++
   1 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/libs/proto/example/vec3.cpp
==============================================================================
--- trunk/libs/proto/example/vec3.cpp (original)
+++ trunk/libs/proto/example/vec3.cpp 2010-11-02 18:27:22 EDT (Tue, 02 Nov 2010)
@@ -113,6 +113,16 @@
         return *this;
     }
 
+ // This copy-assign is needed because a template is never
+ // considered for copy assignment.
+ Vec3 &operator=(Vec3 const &that)
+ {
+ (*this)[0] = that[0];
+ (*this)[1] = that[1];
+ (*this)[2] = that[2];
+ return *this;
+ }
+
     void print() const
     {
         std::cout << '{' << (*this)[0]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk