From aeb2c3b49ccdbdd98b25f7ec289f320a91cf0230 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com>
Date: Thu, 5 Apr 2018 21:24:53 +0200
Subject: [PATCH] staticly checks if template parameter is an arithmetic type
 for construction or assignation from 'zero'

---
 algebra/TinyVector.hpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/algebra/TinyVector.hpp b/algebra/TinyVector.hpp
index d2a30abf1..95dfda712 100644
--- a/algebra/TinyVector.hpp
+++ b/algebra/TinyVector.hpp
@@ -112,6 +112,7 @@ public:
   KOKKOS_INLINE_FUNCTION
   TinyVector& operator=(const ZeroType& z)
   {
+    static_assert(std::is_arithmetic<T>(),"Cannot assign 'zero' value for non-arithmetic types");
     for (size_t i=0; i<N; ++i) {
       m_values[i] = 0;
     }
@@ -147,6 +148,7 @@ public:
   KOKKOS_INLINE_FUNCTION
   TinyVector(const ZeroType& z)
   {
+    static_assert(std::is_arithmetic<T>(),"Cannot construct from 'zero' value for non-arithmetic types");
     for (size_t i=0; i<N; ++i) {
       m_values[i] = 0;
     }
-- 
GitLab