Re: [eigen] proposal to use static const integer class members instead of enum values |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] proposal to use static const integer class members instead of enum values
- From: <Daniel.Vollmer@xxxxxx>
- Date: Mon, 15 Dec 2014 08:17:28 +0000
- Accept-language: de-DE, en-US
- Thread-index: AQHQFwL2uKLTSkxMkkWTE/PdajVkD5yNy7uAgAADJQCAAAR9AIAABP4AgAAGy4CAAEVFpYAAiBoAgAGjN8E=
- Thread-topic: [eigen] proposal to use static const integer class members instead of enum values
Hi
> The main goal of deriving from integer_constant is to have only one class
> that needs the definition, as long as the constant is always called value..
> But since in Eigen the constants can have many, many different names
> (IsColVector, ExpandMem, RowsAtCompileTime, OuterSize, etc) it wouldn't
> gain much if anything.
Well, wouldn't you then just have all these constants be derived from
integral_constant (in C++11-speak) and then call IsColVector::value etc.?
That's what I'm doing in our C++11 codebase, but mixing between the two styles
is a bit annoying, so I often create an integral_constant for an Eigen-enum, e.g.
SizeAtCompileTime.
As a slight aside, I'm looking forward to a much simplified Eigen4 that is allowed to use
C++11 features... ;-)
Best regards
Daniel Vollmer
--------------------------
Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)
German Aerospace Center
Institute of Aerodynamics and Flow Technology | Lilienthalplatz 7 | 38108 Braunschweig | Germany