diff --git a/lib/math/Grid_math_poke.h b/lib/math/Grid_math_poke.h index 3f1cb89e..a015478e 100644 --- a/lib/math/Grid_math_poke.h +++ b/lib/math/Grid_math_poke.h @@ -7,23 +7,20 @@ namespace Grid { ////////////////////////////////////////////////////////////////////////////// // Scalar poke -template inline - void pokeIndex(iScalar &ret, - const typename std::enable_if,Level>::value,iScalar >::type &arg) +template::TensorLevel == Level >::type * =nullptr> inline + void pokeIndex(iScalar &ret, const iScalar &arg) { ret._internal = arg._internal; } // Vector poke, one index -template inline - void pokeIndex(iVector &ret, - const typename std::enable_if,Level>::value,iScalar >::type &arg,int i) +template::TensorLevel == Level >::type * =nullptr> inline + void pokeIndex(iVector &ret, const iScalar &arg,int i) { ret._internal[i] = arg._internal; } // Vector poke, two indices -template inline - void pokeIndex(iMatrix &ret, - const typename std::enable_if,Level>::value,iScalar >::type &arg,int i,int j) +template::TensorLevel == Level >::type * =nullptr> inline + void pokeIndex(iMatrix &ret, const iScalar &arg,int i,int j) { ret._internal[i][j] = arg._internal; } @@ -32,55 +29,41 @@ template inline // No match poke for scalar,vector,matrix must forward on either 0,1,2 args. Must have 9 routines with notvalue ///////////// // scalar -template inline - void pokeIndex(iScalar &ret, - const typename std::enable_if,Level>::notvalue,iScalar(ret._internal))> >::type &arg) +template::TensorLevel != Level >::type * =nullptr> inline +void pokeIndex(iScalar &ret, const iScalar(ret._internal))> &arg) { pokeIndex(ret._internal,arg._internal); } -template inline - void pokeIndex(iScalar &ret, - const typename std::enable_if,Level>::notvalue,iScalar(ret._internal,0))> >::type &arg, - int i) +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iScalar &ret, const iScalar(ret._internal,0))> &arg, int i) { pokeIndex(ret._internal,arg._internal,i); } -template inline - void pokeIndex(iScalar &ret, - const typename std::enable_if,Level>::notvalue,iScalar(ret._internal,0,0))> >::type &arg, - int i,int j) - +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iScalar &ret, const iScalar(ret._internal,0,0))> &arg,int i,int j) { pokeIndex(ret._internal,arg._internal,i,j); } // Vector -template inline - void pokeIndex(iVector &ret, - const typename std::enable_if,Level>::notvalue,iVector(ret._internal)),N> >::type &arg) - +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iVector &ret, iVector(ret._internal)),N> &arg) { for(int ii=0;ii(ret._internal[ii],arg._internal[ii]); } } -template inline - void pokeIndex(iVector &ret, - const typename std::enable_if,Level>::notvalue,iVector(ret._internal,0)),N> >::type &arg, - int i) - +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iVector &ret, const iVector(ret._internal,0)),N> &arg,int i) { for(int ii=0;ii(ret._internal[ii],arg._internal[ii],i); } } -template inline - void pokeIndex(iVector &ret, - const typename std::enable_if,Level>::notvalue,iVector(ret._internal,0,0)),N> >::type &arg, - int i,int j) - +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iVector &ret, const iVector(ret._internal,0,0)),N> &arg,int i,int j) { for(int ii=0;ii(ret._internal[ii],arg._internal[ii],i,j); @@ -88,32 +71,24 @@ template inline } // Matrix -template inline - void pokeIndex(iMatrix &ret, - const typename std::enable_if,Level>::notvalue,iMatrix(ret._internal)),N> >::type &arg) - +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iMatrix &ret, const iMatrix(ret._internal)),N> &arg) { for(int ii=0;ii(ret._internal[ii][jj],arg._internal[ii][jj]); }} } -template inline - void pokeIndex(iMatrix &ret, - const typename std::enable_if,Level>::notvalue,iMatrix(ret._internal,0)),N> >::type &arg, - int i) - +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iMatrix &ret, const iMatrix(ret._internal,0)),N> &arg,int i) { for(int ii=0;ii(ret._internal[ii][jj],arg._internal[ii][jj],i); }} } -template inline - void pokeIndex(iMatrix &ret, - const typename std::enable_if,Level>::notvalue,iMatrix(ret._internal,0,0)),N> >::type &arg, - int i,int j) - +template::TensorLevel != Level >::type * =nullptr> inline + void pokeIndex(iMatrix &ret, const iMatrix(ret._internal,0,0)),N> &arg, int i,int j) { for(int ii=0;ii