Changeset 56:0b4cafcc1b46 in rrlib_geometry


Ignore:
Timestamp:
05.09.2013 19:03:40 (6 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Message:

Replaced mutable keyword by capture-by-reference in lambdas to avoid segfaults

Location:
curves
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • curves/tBezierCurve.hpp

    r54 r56  
    9393  static_assert(sizeof...(rest) + 1 == Tdegree, "A Bezier curve must have degree + 1 control points"); 
    9494  size_t index = 0; 
    95   util::ProcessVariadicValues([this, index](const typename tShape::tPoint & x) mutable { this->control_points[index++] = x; }, p1, p2, rest...); 
     95  util::ProcessVariadicValues([this, &index](const typename tShape::tPoint & x) 
     96  { 
     97    this->control_points[index++] = x; 
     98  }, 
     99  p1, p2, rest...); 
    96100} 
    97101 
  • curves/tSplineCurve.hpp

    r55 r56  
    8989  static_assert(Tdegree > 0, "The degree of spline curves must be greater than zero"); 
    9090  static_assert(sizeof...(rest) + 2 > Tdegree, "A spline curve needs at least degree + 1 control points"); 
    91   util::ProcessVariadicValues([this](const typename tShape::tPoint & x) mutable { this->control_points.push_back(x); }, p1, p2, rest...); 
     91  util::ProcessVariadicValues([this](const typename tShape::tPoint & x) 
     92  { 
     93    this->control_points.push_back(x); 
     94  }, 
     95  p1, p2, rest...); 
    9296} 
    9397 
Note: See TracChangeset for help on using the changeset viewer.