Ticket #10762: 0001-Fix-typo-in-fixed_matrix-move-assignment.patch

File 0001-Fix-typo-in-fixed_matrix-move-assignment.patch, 1.4 KB (added by James Benze, 8 years ago)
  • include/boost/numeric/ublas/matrix.hpp

    From 344ea415c712854d4e8e998f24017a5e3f158f1b Mon Sep 17 00:00:00 2001
    From: James Benze <jabenze@berriehill.com>
    Date: Thu, 6 Nov 2014 10:14:06 -0500
    Subject: [PATCH] Fix typo in fixed_matrix move-assignment
    
    The move assignment operator= had an operand of "matrix", which is an
    undefined type, causing a compile error.  Changing the type to "fixed_matrix"
    solves the problem.
    
    Since this is supposed to be a move-assignment operator, I made it take an
    r-value reference as well, which seems to be the general agreed-upon way
    to define this operator.
    
    This is related to trac bug #10762
    ---
     include/boost/numeric/ublas/matrix.hpp | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp
    index d063910..9ec4395 100644
    a b namespace boost { namespace numeric {  
    13821382        // Assignment
    13831383#ifdef BOOST_UBLAS_MOVE_SEMANTICS
    13841384
    1385         /*! @note "pass by value" the key idea to enable move semantics */
     1385        /*! @note "rvalue-reference" the key idea to enable move semantics */
    13861386        BOOST_UBLAS_INLINE
    1387         fixed_matrix &operator = (matrix m) {
     1387        fixed_matrix &operator = (fixed_matrix && m) {
    13881388            assign_temporary(m);
    13891389            return *this;
    13901390        }