static_assert

This commit is contained in:
2020-08-19 16:48:08 +03:00
parent ccd6a9888f
commit 05607ccf0e
6 changed files with 13 additions and 4 deletions

View File

@@ -36,6 +36,8 @@ class PIMathMatrixT;
template<uint Size, typename Type = double>
class PIP_EXPORT PIMathVectorT {
typedef PIMathVectorT<Size, Type> _CVector;
static_assert(std::is_arithmetic<Type>::value, "Type must be arithmetic");
static_assert(Size > 0, "Size count must be > 0");
public:
PIMathVectorT() {resize();}
PIMathVectorT(const PIVector<Type> & val) {resize(); PIMV_FOR(i, 0) c[i] = val[i];}