toward the mountain
C++ little things
Table of Contents
C++ skills
C++ skills
return temporary object by const reference is OK-
DO NOT return temporary object by const reference
- There are some weird bugs as result.
- temporary Smart pointer will be deconstructed in this case
- Always return pointer by value
Pass Eigen Matrix parameter
- Passing part of Eigen::Matrix using block
/// function decleration
func(Eigen::Ref<Eigen::Matrix<3,1> >);
Eigen::Matrix<3,1> mat;
func(
mat.block(startRow
, startCol
, rows
, cols)
);
C++
C++ skills