#39 #40 git add for last commit

This commit is contained in:
toni
2017-11-15 17:46:06 +01:00
parent c8063bc862
commit 95a5c8f34f
49 changed files with 4661 additions and 0 deletions

69
smc/ParticleAssertions.h Normal file
View File

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