diff --git a/dune/common/densematrix.hh b/dune/common/densematrix.hh index 6d7d6f306fc38cbe76b5271eba7361da4b00ca34..4cd46617ddd04ea9b578da130fba71613d886d37 100644 --- a/dune/common/densematrix.hh +++ b/dune/common/densematrix.hh @@ -12,7 +12,6 @@ #include <dune/common/exceptions.hh> #include <dune/common/fvector.hh> #include <dune/common/precision.hh> -#include <dune/common/static_assert.hh> #include <dune/common/classname.hh> #include <dune/common/math.hh> #include <dune/common/unused.hh> @@ -142,7 +141,7 @@ namespace Dune { static void apply ( M &m, const T &t ) { - dune_static_assert( (Conversion< const T, const M >::exists), "No template specialization of DenseMatrixAssigner found" ); + static_assert( (Conversion< const T, const M >::exists), "No template specialization of DenseMatrixAssigner found" ); m = static_cast< const M & >( t ); } }; diff --git a/dune/common/documentation.hh b/dune/common/documentation.hh index e783a9c44ec0283a4d6c6838be075ebc9c9dc9f9..071ac2c591bb2e3520769a66fd05b8cd23ab1f5d 100644 --- a/dune/common/documentation.hh +++ b/dune/common/documentation.hh @@ -19,8 +19,8 @@ namespace Dune { * // Traits class that determines some property for some other type T * template<class T> * class SomeTraits { - * dune_static_assert(AlwaysFalse<T>::value, - * "Sorry, SomeTraits must be specialized for all types"); + * static_assert(AlwaysFalse<T>::value, + * "Sorry, SomeTraits must be specialized for all types"); * public: * // The type of some property of T * typedef ImplementationDefined type; diff --git a/dune/common/dynmatrix.hh b/dune/common/dynmatrix.hh index 96a8fef11bab87dff6ff5e0467c88a74b4191aac..b23ee398f8fc35627c2c4feea07fd394cc07ab1c 100644 --- a/dune/common/dynmatrix.hh +++ b/dune/common/dynmatrix.hh @@ -11,7 +11,6 @@ #include <dune/common/exceptions.hh> #include <dune/common/dynvector.hh> #include <dune/common/densematrix.hh> -#include <dune/common/static_assert.hh> namespace Dune { diff --git a/dune/common/fmatrix.hh b/dune/common/fmatrix.hh index 95190a0b55ee8d4f7413bd0c6356c6e530e1a3d2..8db1b577148f2028aa6c3daa0e110624ac94e145 100644 --- a/dune/common/fmatrix.hh +++ b/dune/common/fmatrix.hh @@ -13,7 +13,6 @@ #include <dune/common/fvector.hh> #include <dune/common/densematrix.hh> #include <dune/common/precision.hh> -#include <dune/common/static_assert.hh> #include <dune/common/std/constexpr.hh> namespace Dune diff --git a/dune/common/forloop.hh b/dune/common/forloop.hh index eb6b265b79c7b77d81656250707d9e77172f3ed4..330ca572b7c7b9e91e373fce219ddfccbbc7376f 100644 --- a/dune/common/forloop.hh +++ b/dune/common/forloop.hh @@ -8,8 +8,6 @@ * \brief A static for loop for template meta-programming */ -#include <dune/common/static_assert.hh> - namespace Dune { @@ -21,7 +19,7 @@ namespace Dune class GenericForLoop : public Operation< Value< first >, GenericForLoop< Operation, Value, first+1, last > > { - dune_static_assert( (first <= last), "GenericForLoop: first > last" ); + static_assert( (first <= last), "GenericForLoop: first > last" ); }; template< template< class, class > class Operation, template< int > class Value, int last > @@ -221,7 +219,7 @@ namespace Dune class ForLoop : public GenericForLoop< ForLoopHelper::Apply, Operation, first, last > { - dune_static_assert( (first <= last), "ForLoop: first > last" ); + static_assert( (first <= last), "ForLoop: first > last" ); }; } diff --git a/dune/common/fvector.hh b/dune/common/fvector.hh index 0696f030576517e98799ffa488942e6fa043f82b..9e0098d99274218345e92071791e342de1cf7ea2 100644 --- a/dune/common/fvector.hh +++ b/dune/common/fvector.hh @@ -10,7 +10,7 @@ #include <complex> #include <cstring> #include <utility> -#include<initializer_list> +#include <initializer_list> #include <dune/common/std/constexpr.hh> @@ -18,7 +18,6 @@ #include "exceptions.hh" #include "array.hh" #include "densevector.hh" -#include "static_assert.hh" #include "unused.hh" namespace Dune { @@ -152,7 +151,7 @@ namespace Dune { template<class K1, int SIZE1> explicit FieldVector (const FieldVector<K1,SIZE1> & x) { - dune_static_assert(SIZE1 == SIZE, "FieldVector in constructor has wrong size"); + static_assert(SIZE1 == SIZE, "FieldVector in constructor has wrong size"); for (size_type i = 0; i<SIZE; i++) _data[i] = x[i]; } @@ -235,7 +234,7 @@ namespace Dune { template<class C> FieldVector (const DenseVector<C> & x) { - dune_static_assert(((bool)IsFieldVectorSizeCorrect<C,1>::value), "FieldVectors do not match in dimension!"); + static_assert(((bool)IsFieldVectorSizeCorrect<C,1>::value), "FieldVectors do not match in dimension!"); assert(x.size() == 1); _data = x[0]; } diff --git a/dune/common/gcd.hh b/dune/common/gcd.hh index b685fa07a6baa0ce6de96ac7cbff9abb7b3e2e31..30a69a02b4483774b28ff0a9f34483ff59f34735 100644 --- a/dune/common/gcd.hh +++ b/dune/common/gcd.hh @@ -3,7 +3,6 @@ #ifndef DUNE_GCD_HH #define DUNE_GCD_HH -#include "static_assert.hh" namespace Dune { /** @@ -32,8 +31,8 @@ namespace Dune */ static void conceptCheck() { - dune_static_assert(b<a, "b<a must hold!"); - dune_static_assert(0<b, "b must be positive"); + static_assert(b<a, "b<a must hold!"); + static_assert(0<b, "b must be positive"); } diff --git a/dune/common/hash.hh b/dune/common/hash.hh index 251276eb142b85b557c98219296650bfe369e1c3..a0468d1f894d062bf6690dc0226a156456c8d6cd 100644 --- a/dune/common/hash.hh +++ b/dune/common/hash.hh @@ -4,7 +4,6 @@ #define DUNE_COMMON_HASH_HH #include <dune/common/typetraits.hh> -#include <dune/common/static_assert.hh> #if HAVE_STD_HASH #include <functional> @@ -359,7 +358,7 @@ namespace Dune { template<typename typeof_size_t, typename T> void operator()(typeof_size_t& seed, const T& arg) const { - dune_static_assert(sizeof(typeof_size_t)==8, "hash_combiner::operator() instantiated with nonmatching type and size"); + static_assert(sizeof(typeof_size_t)==8, "hash_combiner::operator() instantiated with nonmatching type and size"); // The following algorithm for combining two 64-bit hash values is inspired by a similar // function in CityHash (http://cityhash.googlecode.com/svn-history/r2/trunk/src/city.h), @@ -396,7 +395,7 @@ namespace Dune { template<typename typeof_size_t, typename T> void operator()(typeof_size_t& seed, const T& arg) const { - dune_static_assert(sizeof(typeof_size_t)==4, "hash_combiner::operator() instantiated with nonmatching type and size"); + static_assert(sizeof(typeof_size_t)==4, "hash_combiner::operator() instantiated with nonmatching type and size"); // The default algorithm above requires a 64-bit std::size_t. The following algorithm is a // 32-bit compatible fallback, again inspired by CityHash and MurmurHash diff --git a/dune/common/lcm.hh b/dune/common/lcm.hh index 5ef9dc72b6fc604ae72721f7dcd3041f392059ca..cf8c5d340281729905f96360254bd066a8be52ee 100644 --- a/dune/common/lcm.hh +++ b/dune/common/lcm.hh @@ -7,7 +7,6 @@ * \brief Statically compute the least common multiple of two integers */ -#include <dune/common/static_assert.hh> #include <dune/common/gcd.hh> namespace Dune @@ -31,8 +30,8 @@ namespace Dune { static void conceptCheck() { - dune_static_assert(0<m, "m must be positive!"); - dune_static_assert(0<n, "n must be positive!"); + static_assert(0<m, "m must be positive!"); + static_assert(0<n, "n must be positive!"); } /** * @brief The least common multiple of the template parameters diff --git a/dune/common/parallel/remoteindices.hh b/dune/common/parallel/remoteindices.hh index 91d885e4ccff070e88bb95bbea0bc79809b86d06..97227e95fde261179758dfe6595a54a425b63028 100644 --- a/dune/common/parallel/remoteindices.hh +++ b/dune/common/parallel/remoteindices.hh @@ -9,7 +9,6 @@ #include <dune/common/exceptions.hh> #include <dune/common/poolallocator.hh> #include <dune/common/sllist.hh> -#include <dune/common/static_assert.hh> #include <dune/common/stdstreams.hh> #include <map> #include <set> @@ -1606,9 +1605,9 @@ namespace Dune { template<typename T, typename A, bool mode> inline void RemoteIndexListModifier<T,A,mode>::insert(const RemoteIndex& index) throw(InvalidPosition) { - dune_static_assert(!mode,"Not allowed if the mode indicates that new indices" - "might be added to the underlying index set. Use " - "insert(const RemoteIndex&, const GlobalIndex&) instead"); + static_assert(!mode,"Not allowed if the mode indicates that new indices" + "might be added to the underlying index set. Use " + "insert(const RemoteIndex&, const GlobalIndex&) instead"); #ifdef DUNE_ISTL_WITH_CHECKING if(!first_ && index.localIndexPair().global()<last_) @@ -1629,7 +1628,7 @@ namespace Dune { template<typename T, typename A, bool mode> inline void RemoteIndexListModifier<T,A,mode>::insert(const RemoteIndex& index, const GlobalIndex& global) throw(InvalidPosition) { - dune_static_assert(mode,"Not allowed if the mode indicates that no new indices" + static_assert(mode,"Not allowed if the mode indicates that no new indices" "might be added to the underlying index set. Use " "insert(const RemoteIndex&) instead"); #ifdef DUNE_ISTL_WITH_CHECKING diff --git a/dune/common/poolallocator.hh b/dune/common/poolallocator.hh index 16fd3a71904ee371a9077773ae5a61afbf077e3b..8aa49746286fb640c8490f6e5ad11351948bfbb5 100644 --- a/dune/common/poolallocator.hh +++ b/dune/common/poolallocator.hh @@ -9,7 +9,6 @@ */ #include "alignment.hh" -#include "static_assert.hh" #include "lcm.hh" #include <typeinfo> #include <iostream> @@ -448,14 +447,14 @@ namespace Dune inline Pool<T,S>::Pool() : head_(0), chunks_(0) //, allocated_(0) { - dune_static_assert(sizeof(T)<=unionSize, "Library Error: type T is too big"); - dune_static_assert(sizeof(Reference)<=unionSize, "Library Error: type of referene is too big"); - dune_static_assert(unionSize<=alignedSize, "Library Error: alignedSize too small"); - dune_static_assert(sizeof(T)<=chunkSize, "Library Error: chunkSize must be able to hold at least one value"); - dune_static_assert(sizeof(Reference)<=chunkSize, "Library Error: chunkSize must be able to hold at least one reference"); - dune_static_assert((chunkSize - (alignment - 1)) % alignment == 0, "Library Error: compiler cannot calculate!"); - dune_static_assert(elements>=1, "Library Error: we need to hold at least one element!"); - dune_static_assert(elements*alignedSize<=chunkSize, "Library Error: aligned elements must fit into chuck!"); + static_assert(sizeof(T)<=unionSize, "Library Error: type T is too big"); + static_assert(sizeof(Reference)<=unionSize, "Library Error: type of referene is too big"); + static_assert(unionSize<=alignedSize, "Library Error: alignedSize too small"); + static_assert(sizeof(T)<=chunkSize, "Library Error: chunkSize must be able to hold at least one value"); + static_assert(sizeof(Reference)<=chunkSize, "Library Error: chunkSize must be able to hold at least one reference"); + static_assert((chunkSize - (alignment - 1)) % alignment == 0, "Library Error: compiler cannot calculate!"); + static_assert(elements>=1, "Library Error: we need to hold at least one element!"); + static_assert(elements*alignedSize<=chunkSize, "Library Error: aligned elements must fit into chuck!"); /* std::cout<<"s= "<<S<<" : T: "<<sizeof(T)<<" Reference: "<<sizeof(Reference)<<" union: "<<unionSize<<" alignment: "<<alignment<< "aligned: "<<alignedSize<<" chunk: "<< chunkSize<<" elements: "<<elements<<std::endl;*/ } diff --git a/dune/common/propertymap.hh b/dune/common/propertymap.hh index 49aa92dd3be2511f14651366adc287b426f6b2ab..3f7e917c80736b2a41e4e8cce39e9c6cb1114194 100644 --- a/dune/common/propertymap.hh +++ b/dune/common/propertymap.hh @@ -7,7 +7,6 @@ #include <cstddef> #include <iterator> -#include "static_assert.hh" #include "typetraits.hh" namespace Dune @@ -93,7 +92,7 @@ namespace Dune put(const RAPropertyMapHelper<Reference,PropertyMap>& pmap, const Key& key, const Value& value) { - dune_static_assert((Conversion<typename PropertyMap::Category,WritablePropertyMapTag> + static_assert((Conversion<typename PropertyMap::Category,WritablePropertyMapTag> ::exists), "WritablePropertyMapTag required!"); static_cast<const PropertyMap&>(pmap)[key] = value; } diff --git a/dune/common/test/CMakeLists.txt b/dune/common/test/CMakeLists.txt index 889c0a50b28b914441c0dab72aa05205ba2b21d6..61ac427d351fa0dfc6670464cfda0b3529e3c160 100644 --- a/dune/common/test/CMakeLists.txt +++ b/dune/common/test/CMakeLists.txt @@ -28,7 +28,6 @@ set(TESTS poolallocatortest shared_ptrtest_config singletontest - static_assert_test streamtest testfassign1 testfassign2 @@ -61,7 +60,6 @@ set(COMPILEFAILTESTS check_fvector_size_fail2 genericiterator_compile_fail nullptr-test-fail - static_assert_test_fail testfconstruct_fail1 testfconstruct_fail2) @@ -155,8 +153,6 @@ add_executable("poolallocatortest" poolallocatortest.cc) add_executable("shared_ptrtest_config" shared_ptrtest.cc) add_executable("singletontest" singletontest.cc) add_executable("sllisttest" EXCLUDE_FROM_ALL sllisttest.cc) -add_executable("static_assert_test" EXCLUDE_FROM_ALL static_assert_test.cc) -add_executable("static_assert_test_fail" EXCLUDE_FROM_ALL static_assert_test_fail.cc) add_executable("streamtest" streamtest.cc) target_link_libraries("streamtest" "dunecommon") diff --git a/dune/common/test/Makefile.am b/dune/common/test/Makefile.am index 60b668ca8d9cdb9f971aefc2d0e8f6224323bf85..b4eedef94ec969aef8e13d433a656e55a91838c3 100644 --- a/dune/common/test/Makefile.am +++ b/dune/common/test/Makefile.am @@ -30,7 +30,6 @@ TESTPROGS = \ poolallocatortest \ shared_ptrtest_config \ singletontest \ - static_assert_test \ streamtest \ testdebugallocator \ testdebugallocator_fail1 \ @@ -65,7 +64,6 @@ COMPILE_XFAIL_TESTS = \ check_fvector_size_fail2 \ genericiterator_compile_fail \ nullptr-test-fail \ - static_assert_test_fail \ testfconstruct_fail1 \ testfconstruct_fail2 @@ -192,9 +190,6 @@ sllisttest_SOURCES = sllisttest.cc sourcescheck_NOSOURCES = timing.cc -static_assert_test_SOURCES = static_assert_test.cc -static_assert_test_fail_SOURCES = static_assert_test_fail.cc - streamtest_SOURCES = streamtest.cc testdebugallocator_SOURCES = testdebugallocator.cc diff --git a/dune/common/test/fvectortest.cc b/dune/common/test/fvectortest.cc index b1dd3d0f5f7748b17f8396a0eb00cf3cc20997a8..b0fe17ca134c7976056e2c81ecf4a3b0d8931769 100644 --- a/dune/common/test/fvectortest.cc +++ b/dune/common/test/fvectortest.cc @@ -6,7 +6,6 @@ #include <dune/common/fvector.hh> #include <dune/common/exceptions.hh> #include <dune/common/typetraits.hh> -#include <dune/common/static_assert.hh> #include <dune/common/classname.hh> #include <iostream> #include <complex> @@ -33,16 +32,16 @@ struct FieldVectorMainTest std::cout << __func__ << "\t ( " << className(v) << " )" << std::endl; // test traits - dune_static_assert( + static_assert( ( Dune::is_same< typename Dune::FieldTraits< FieldVector<ft,d> >::field_type, ft >::value ), "FieldTraits<FieldVector> yields wrong field_type" ); - dune_static_assert( + static_assert( ( Dune::is_same< typename Dune::FieldTraits<ft>::real_type, rt >::value ), "FieldTraits<field_type> yields wrong real_type" ); - dune_static_assert( + static_assert( ( Dune::is_same< typename Dune::FieldTraits< FieldVector<ft,d> >::real_type, rt >::value ), "FieldTraits<FieldVector> yields wrong real_type" @@ -211,7 +210,7 @@ struct DotProductTest typedef std::complex<rt> ct; const rt myEps(1e-6); - dune_static_assert( + static_assert( ( Dune::is_same< typename Dune::FieldTraits<rt>::real_type, rt>::value ), "DotProductTest requires real data type as template parameter!" ); @@ -224,8 +223,8 @@ struct DotProductTest const bool isRealOne = Dune::is_same<typename Dune::FieldTraits<rt>::field_type,typename Dune::FieldTraits<rt>::real_type>::value; const bool isRealIVec = Dune::is_same<typename Dune::FieldTraits<ct>::field_type,typename Dune::FieldTraits<ct>::real_type> ::value; - dune_static_assert(isRealOne,"1-vector expected to be real"); - dune_static_assert(!isRealIVec,"i-vector expected to be complex"); + static_assert(isRealOne,"1-vector expected to be real"); + static_assert(!isRealIVec,"i-vector expected to be complex"); ct result = ct(); ct length = ct(d); diff --git a/dune/common/test/gcdlcmtest.cc b/dune/common/test/gcdlcmtest.cc index f1f85407ef6bd9b8c6218bd6bd2ce6d2661be0c4..31d478f5c84aaa78f2ff9a8bc0ac335f21b82ed2 100644 --- a/dune/common/test/gcdlcmtest.cc +++ b/dune/common/test/gcdlcmtest.cc @@ -8,14 +8,17 @@ #include <dune/common/gcd.hh> #include <dune/common/lcm.hh> -#include <dune/common/static_assert.hh> void test() { - dune_static_assert((Dune::Gcd<2*2*2*5*5*5*11, 2*2*5*13>::value == 2*2*5), "gcd not working properly"); - dune_static_assert((Dune::Lcm<11,3>::value == 33), "lcm not working properly"); - dune_static_assert((Dune::Lcm<18,15>::value == 18*15/3), "lcm not working properly"); - dune_static_assert((Dune::Lcm<10800,Dune::Lcm<36000,7680>::value>::value==1728000), "lcm not working properly"); + static_assert((Dune::Gcd<2*2*2*5*5*5*11, 2*2*5*13>::value == 2*2*5), + "gcd not working properly"); + static_assert((Dune::Lcm<11,3>::value == 33), + "lcm not working properly"); + static_assert((Dune::Lcm<18,15>::value == 18*15/3), + "lcm not working properly"); + static_assert((Dune::Lcm<10800,Dune::Lcm<36000,7680>::value>::value==1728000), + "lcm not working properly"); } int main() diff --git a/dune/common/test/static_assert_test.cc b/dune/common/test/static_assert_test.cc deleted file mode 100644 index e7ac0b2db6117579fd58010b1783e1d778081b13..0000000000000000000000000000000000000000 --- a/dune/common/test/static_assert_test.cc +++ /dev/null @@ -1,12 +0,0 @@ -// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -// vi: set et ts=4 sw=2 sts=2: -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <dune/common/static_assert.hh> - -int main() -{ - dune_static_assert(true, "OK"); - return 0; -} diff --git a/dune/common/test/static_assert_test_fail.cc b/dune/common/test/static_assert_test_fail.cc deleted file mode 100644 index a3a6520742183b728eddb463da87acaf7a361311..0000000000000000000000000000000000000000 --- a/dune/common/test/static_assert_test_fail.cc +++ /dev/null @@ -1,12 +0,0 @@ -// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -// vi: set et ts=4 sw=2 sts=2: -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <dune/common/static_assert.hh> - -int main() -{ - dune_static_assert(false, "FAIL"); - return 0; -} diff --git a/dune/common/test/tuplestest.cc b/dune/common/test/tuplestest.cc index acc7172bafad9fac02d9ae5ed0f87988022dc1f9..8da8706fa4a8326f2061284723dfddcd1c07400e 100644 --- a/dune/common/test/tuplestest.cc +++ b/dune/common/test/tuplestest.cc @@ -62,7 +62,7 @@ int iteratorTupleTest() Tuple tuple_(v.begin(), v.begin(), v.end()); - dune_static_assert(tuple_size<Tuple>::value==3, "The tuple size should be 3!");; + static_assert(tuple_size<Tuple>::value==3, "The tuple size should be 3!");; int ret=0; diff --git a/dune/common/test/tupleutilitytest.cc b/dune/common/test/tupleutilitytest.cc index 6ee3e4fdd5fb2cc4c9c2a73d0e5010b15e996cc9..74381b102f4acc24f0d015e774bea8c15d78fb6a 100644 --- a/dune/common/test/tupleutilitytest.cc +++ b/dune/common/test/tupleutilitytest.cc @@ -7,7 +7,6 @@ #include <cstddef> -#include <dune/common/static_assert.hh> #include <dune/common/tuples.hh> #include <dune/common/tupleutility.hh> @@ -16,15 +15,12 @@ // check FirstTypeIndex // typedef Dune::tuple<int, unsigned, double> MyTuple; -dune_static_assert((Dune::FirstTypeIndex<MyTuple, int>::value == 0), - "FirstTypeIndex finds the wrong index for double in " - "MyTuple!"); -dune_static_assert((Dune::FirstTypeIndex<MyTuple, unsigned>::value == 1), - "FirstTypeIndex finds the wrong index for double in " - "MyTuple!"); -dune_static_assert((Dune::FirstTypeIndex<MyTuple, double>::value == 2), - "FirstTypeIndex finds the wrong index for double in " - "MyTuple!"); +static_assert((Dune::FirstTypeIndex<MyTuple, int>::value == 0), + "FirstTypeIndex finds the wrong index for double in MyTuple!"); +static_assert((Dune::FirstTypeIndex<MyTuple, unsigned>::value == 1), + "FirstTypeIndex finds the wrong index for double in MyTuple!"); +static_assert((Dune::FirstTypeIndex<MyTuple, double>::value == 2), + "FirstTypeIndex finds the wrong index for double in MyTuple!"); @@ -33,8 +29,8 @@ dune_static_assert((Dune::FirstTypeIndex<MyTuple, double>::value == 2), // check PushBackTuple typedef Dune::PushBackTuple<MyTuple, char>::type MyTupleAppended1; typedef Dune::tuple<int, unsigned, double, char> MyTupleAppended2; -dune_static_assert((Dune::is_same<MyTupleAppended1, MyTupleAppended2>::value), - "PushBackTuple failed!"); +static_assert((Dune::is_same<MyTupleAppended1, MyTupleAppended2>::value), + "PushBackTuple failed!"); @@ -43,8 +39,8 @@ dune_static_assert((Dune::is_same<MyTupleAppended1, MyTupleAppended2>::value), // check PushFrontTuple typedef Dune::PushFrontTuple<MyTuple, char>::type MyTuplePrepended1; typedef Dune::tuple<char, int, unsigned, double> MyTuplePrepended2; -dune_static_assert((Dune::is_same<MyTuplePrepended1, MyTuplePrepended2>::value), - "PushFrontTuple failed!"); +static_assert((Dune::is_same<MyTuplePrepended1, MyTuplePrepended2>::value), + "PushFrontTuple failed!"); @@ -53,8 +49,8 @@ dune_static_assert((Dune::is_same<MyTuplePrepended1, MyTuplePrepended2>::value), // check JoinTuples typedef Dune::JoinTuples<MyTuple, MyTuple>::type MyTupleMyTuple1; typedef Dune::tuple<int, unsigned, double, int, unsigned, double> MyTupleMyTuple2; -dune_static_assert((Dune::is_same<MyTupleMyTuple1, MyTupleMyTuple2>::value), - "JoinTuples failed!"); +static_assert((Dune::is_same<MyTupleMyTuple1, MyTupleMyTuple2>::value), + "JoinTuples failed!"); @@ -65,8 +61,8 @@ typedef Dune::tuple<char, float> MyTuple2; typedef Dune::tuple<MyTuple, MyTuple2> MyTupleTuple; typedef Dune::FlattenTuple<MyTupleTuple>::type MyTupleTupleFlat1; typedef Dune::tuple<int, unsigned, double, char, float> MyTupleTupleFlat2; -dune_static_assert((Dune::is_same<MyTupleTupleFlat1, MyTupleTupleFlat2>::value), - "FlattenTuples failed!"); +static_assert((Dune::is_same<MyTupleTupleFlat1, MyTupleTupleFlat2>::value), + "FlattenTuples failed!"); @@ -143,8 +139,8 @@ typedef Dune::tuple< Dune::integral_constant<int, 3>, Dune::integral_constant<int, 5>, Dune::integral_constant<int, 7> > Primes2; -dune_static_assert((Dune::is_same<Primes1, Primes2>::value), - "ReduceTuple failed in primes-tmp!"); +static_assert((Dune::is_same<Primes1, Primes2>::value), + "ReduceTuple failed in primes-tmp!"); int main() {} diff --git a/dune/common/test/utilitytest.cc b/dune/common/test/utilitytest.cc index 3016704b83a2d6135629f5af34870d8d91132317..57a4c146f63ab34652c12e6e5a2479f6b0113a6b 100644 --- a/dune/common/test/utilitytest.cc +++ b/dune/common/test/utilitytest.cc @@ -5,7 +5,6 @@ #include "config.h" #endif -#include <dune/common/static_assert.hh> #include <dune/common/tuples.hh> #include <dune/common/typetraits.hh> #include <dune/common/tupleutility.hh> @@ -62,7 +61,7 @@ int main(int, char**) typedef Dune::tuple<int&,char&,long&,char&> RefTuple1; typedef Dune::tuple<int*,char*,long*,char*> PointerTuple1; - dune_static_assert((Dune::is_same<PointerTuple1, + static_assert((Dune::is_same<PointerTuple1, Dune::ForEachType<Dune::AddPtrTypeEvaluator, RefTuple1>::Type>::value), "RefTuple1 with added pointers should be the same as " diff --git a/dune/common/tuples.hh b/dune/common/tuples.hh index abb3625abf3519a9c9ea05548ba03579c1a5d88b..16fcb7263ea23a51b7d6781ada108374e34a093e 100644 --- a/dune/common/tuples.hh +++ b/dune/common/tuples.hh @@ -7,7 +7,6 @@ #include <iostream> #include "typetraits.hh" -#include "static_assert.hh" #include "unused.hh" #ifdef HAVE_TUPLE @@ -847,9 +846,9 @@ namespace Dune { template<typename T1, typename U1> inline bool operator!=(const Pair<T1,Nil>& tuple1, const Pair<U1,Nil>& tuple2) { - dune_static_assert( (IsInteroperable<T1,U1>::value), - "T1 and U1 have to be interoperable, i.e., either " - "conversion from one to the other must exist." ); + static_assert( (IsInteroperable<T1,U1>::value), + "T1 and U1 have to be interoperable, i.e., either " + "conversion from one to the other must exist." ); return (tuple1.first()!=tuple2.first()); } diff --git a/dune/common/tupleutility.hh b/dune/common/tupleutility.hh index e704c7f79f814886a71b3200b60017ce063d6c79..cf0abf8196eefabd30793b9e8e221b1026670036 100644 --- a/dune/common/tupleutility.hh +++ b/dune/common/tupleutility.hh @@ -32,7 +32,7 @@ namespace Dune { */ template <class Tuple> class NullPointerInitialiser { - dune_static_assert(AlwaysFalse<Tuple>::value, "Attempt to use the " + static_assert(AlwaysFalse<Tuple>::value, "Attempt to use the " "unspecialized version of NullPointerInitialiser. " "NullPointerInitialiser needs to be specialized for " "each possible tuple size. Naturally the number of " @@ -194,7 +194,7 @@ namespace Dune { */ template <template <class> class TypeEvaluator, class TupleType> class ForEachType { - dune_static_assert(AlwaysFalse<TupleType>::value, "Attempt to use the " + static_assert(AlwaysFalse<TupleType>::value, "Attempt to use the " "unspecialized version of ForEachType. ForEachType " "needs to be specialized for each possible tuple " "size. Naturally the number of pre-defined " @@ -1516,7 +1516,7 @@ namespace Dune { integral_constant<std::size_t, start>, FirstPredicateIndex<Tuple, Predicate, start+1> >::type { - dune_static_assert(tuple_size<Tuple>::value == size, "The \"size\" " + static_assert(tuple_size<Tuple>::value == size, "The \"size\" " "template parameter of FirstPredicateIndex is an " "implementation detail and should never be set " "explicitly!"); @@ -1526,7 +1526,7 @@ namespace Dune { template<class Tuple, template<class> class Predicate, std::size_t size> class FirstPredicateIndex<Tuple, Predicate, size, size> { - dune_static_assert(AlwaysFalse<Tuple>::value, "None of the tuple element " + static_assert(AlwaysFalse<Tuple>::value, "None of the tuple element " "types matches the predicate!"); }; #endif // !DOXYGEN @@ -1576,7 +1576,7 @@ namespace Dune { template< class Tuple, class T> struct PushBackTuple { - dune_static_assert(AlwaysFalse<Tuple>::value, "Attempt to use the " + static_assert(AlwaysFalse<Tuple>::value, "Attempt to use the " "unspecialized version of PushBackTuple. " "PushBackTuple needs to be specialized for " "each possible tuple size. Naturally the number of " @@ -1671,7 +1671,7 @@ namespace Dune { template< class Tuple, class T> struct PushFrontTuple { - dune_static_assert(AlwaysFalse<Tuple>::value, "Attempt to use the " + static_assert(AlwaysFalse<Tuple>::value, "Attempt to use the " "unspecialized version of PushFrontTuple. " "PushFrontTuple needs to be specialized for " "each possible tuple size. Naturally the number of "