It prevents unwanted implicit conversions from e.g. nullptr to Camera,
Vector2 to Physics::Point etc. By making all the constructors explicit
it is easier to routinely add the keyword to all new classes instead of
thinking about cases when to add and when not to.
Optimalizations in Corrade::TestSuite and Corrade::Utility::Debug leaded
to significant reduction of compilation time - on my machine it was
~5:38 before with building of unit tests enabled, now only ~5:00.
Lowecase didn't prove to be better, because Doxygen cannot implicitly
link to it and it collides with non-type template parameters and private
variables.
Loop unrolling is better to leave up to the compiler, as it will do it
automatically and it doesn't add any maintenance burden. Constexpr
addition, multiplication etc. of Vector would be nice, but will that be
really useful? Maybe once if at all?
Now all possible cases are properly handled (row vector * column vector,
column vector * row vector, ...). All operators taking arbitrary type as
argument (element-wise multiplication) now have std::enable_if only for
numerical types.
Currently moved only non-square functionality from Matrix there. Also
static constant members such as row/column count and size are now
lowercase, as they are variables, not types.
NumericType is corresponding numeric type with size at least the same as
int. It is used in debug operators for Matrix and Vector to prevent
printing chars as characters.
If the type isn't already floating-point, FloatingPointType is
corresponding larger type with sufficient size for normalization of
given integral type.
Also updated type traits for long types, they are now subclassed either
from int or long long based on sizeof(long).
It's now less confusing ("length squared" looks like it's even heavier
than length), but on the other hand it's not so obvious that these two
functions come together.
On the other hand everything of this is done at runtime, so it's less
performant than the previous version, mainly when used in loops. When
the result is declared as constexpr, it is done at compile time, just
like the previous version.
I don't know which version to keep, so there will be both until a good
decision.
It was clashing with the default "initializer-list" constructor, which
is constexpr. This constructor is also explicit, which makes it
impossible to e.g. return Vector<1, T> from function without explicitly
specifying name , while for Vector<2, T> it works:
return {1, 2}; // works for Vector<2, int>
return {1}; // doesn't work for Vector<1, int>
Doxygen produces some false-positive warnings for Matrix and Vector
classes, but the generated documentation is fine. Worked around the
warnings by using @copybrief and @copydetails instead of @copydoc.