Skip to content

Remove const on nested expressions, and remove const_cast in mutators

Submitted by Benoit Jacob

Assigned to Nobody

Link to original bugzilla bug (#178)

Description

Currently expressions tend to store their nested expressions as const, for example at src/Core/Block.h:344, in class Block:

const typename XprType::Nested m_xpr;  

Consequently, mutators have to call const_cast_derived() on the nested expression.

This seems stupid and seems like something we want to fix for Eigen 3.1. By storing nested expressions with their own native constness, we could also drop those const_cast's.

Blocking

#1608