#ifndef PARTICLEASSERTIONS_H #define PARTICLEASSERTIONS_H namespace SMC { /** check whether T provides a += operator */ template class HasOperatorPlusEq { typedef char one; typedef long two; template static one test( decltype(&C::operator+=) ) ; template static two test(...); public: enum { value = sizeof(test(0)) == sizeof(one) }; }; /** check whether T provides a /= operator */ template class HasOperatorDivEq { typedef char one; typedef long two; template static one test( decltype(&C::operator/=) ) ; template static two test(...); public: enum { value = sizeof(test(0)) == sizeof(one) }; }; /** check whether T provides a * operator */ template class HasOperatorMul { typedef char one; typedef long two; template static one test( decltype(&C::operator*) ) ; template static two test(...); public: enum { value = sizeof(test(0)) == sizeof(one) }; }; /** check whether T provides an assignment operator */ template class HasOperatorAssign{ typedef char one; typedef long two; template static one test( decltype(&C::operator=) ) ; template static two test(...); public: enum { value = sizeof(test(0)) == sizeof(one) }; }; } #endif // PARTICLEASSERTIONS_H