From 50deaa80a11d49bca37e4481a1b3fffcb73df330 Mon Sep 17 00:00:00 2001 From: subarutaro Date: Sat, 1 Aug 2020 15:29:13 +0900 Subject: [PATCH] remove FDPS code from inc/pikg_vector.hpp --- inc/pikg_vector.hpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/inc/pikg_vector.hpp b/inc/pikg_vector.hpp index d514ea7..be82da9 100644 --- a/inc/pikg_vector.hpp +++ b/inc/pikg_vector.hpp @@ -116,20 +116,14 @@ namespace PIKG{ } const T & operator[](const int i) const { + assert(i>=0 && i<3); if(0==i) return x; if(1==i) return y; - if(2==i) return z; - std::cout<<"PS_ERROR: Vector invalid access. \n"<<"function: "<<__FUNCTION__<<", line: "<<__LINE__<<", file: "<<__FILE__<=0 && i<3); if(0==i) return x; if(1==i) return y; return z; @@ -282,10 +276,12 @@ namespace PIKG{ } T& operator[](const int i){ + assert(i>=0 && i<2); if(0==i) return x; return y; } const T & operator[](const int i) const { + assert(i>=0 && i<2); if(0==i) return x; return y; }