Commit 687da4e0 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

C++11: Added static_asserts to component-wise constructor.

parent 21cc0aca
Pipeline #45 passed with stage
......@@ -122,8 +122,12 @@ class VectorT {
typename = typename std::enable_if<sizeof...(T) == DIM>::type,
typename = typename std::enable_if<
are_convertible_to<Scalar, T...>::value>::type>
constexpr VectorT(T... vs) : values_ { {static_cast<Scalar>(vs)...} }
{}
constexpr VectorT(T... vs) : values_ { {static_cast<Scalar>(vs)...} } {
static_assert(sizeof...(T) == DIM,
"Invalid number of components specified in constructor.");
static_assert(are_convertible_to<Scalar, T...>::value,
"Not all components are convertible to Scalar.");
}
VectorT(const VectorT &rhs) = default;
VectorT(VectorT &&rhs) = default;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment