Changeset 1142


Ignore:
Timestamp:
Feb 16, 2012, 2:36:04 AM (8 years ago)
Author:
sam
Message:

math: use const references instead of passing arguments by value in
the magic vector swizzling assignment methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/vector.h

    r1141 r1142  
    5656template<typename T, int N> struct XVec2
    5757{
    58     inline Vec2<T> operator =(Vec2<T> that);
     58    inline Vec2<T> operator =(Vec2<T> const &that);
    5959
    6060    static int const I = (N >> 4) & 3;
     
    6565template<typename T, int N> struct XVec3
    6666{
    67     inline Vec3<T> operator =(Vec3<T> that);
     67    inline Vec3<T> operator =(Vec3<T> const &that);
    6868
    6969    static int const I = (N >> 8) & 3;
     
    7676template<typename T, int N> struct XVec4
    7777{
    78     inline Vec4<T> operator =(Vec4<T> that);
     78    inline Vec4<T> operator =(Vec4<T> const &that);
    7979
    8080    static int const I = (N >> 12) & 3;
     
    10131013
    10141014template<typename T, int N>
    1015 inline Vec2<T> XVec2<T, N>::operator =(Vec2<T> that)
     1015inline Vec2<T> XVec2<T, N>::operator =(Vec2<T> const &that)
    10161016{
    10171017    ptr[I] = that[0]; ptr[J] = that[1];
     
    10201020
    10211021template<typename T, int N>
    1022 inline Vec3<T> XVec3<T, N>::operator =(Vec3<T> that)
     1022inline Vec3<T> XVec3<T, N>::operator =(Vec3<T> const &that)
    10231023{
    10241024    ptr[I] = that[0]; ptr[J] = that[1]; ptr[K] = that[2];
     
    10271027
    10281028template<typename T, int N>
    1029 inline Vec4<T> XVec4<T, N>::operator =(Vec4<T> that)
     1029inline Vec4<T> XVec4<T, N>::operator =(Vec4<T> const &that)
    10301030{
    10311031    ptr[I] = that[0]; ptr[J] = that[1]; ptr[K] = that[2]; ptr[L] = that[3];
Note: See TracChangeset for help on using the changeset viewer.