Replace boost::{type_traits, enable_if and mpl} with standard library features...

Replace boost::{type_traits, enable_if and mpl} with standard library features where (easily) possible
parent 9893c79b
......@@ -71,6 +71,8 @@
#include "field/vtk/all.h"
#include "lbm/vtk/all.h"
#include <boost/tuple/tuple.hpp>
#include <vector>
#include <iomanip>
#include <iostream>
......
......@@ -91,9 +91,6 @@
#include "vtk/Initialization.h"
#include "vtk/VTKOutput.h"
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_same.hpp>
#include <algorithm>
#include <cmath>
#include <cstdlib>
......@@ -101,6 +98,7 @@
#include <functional>
#include <iostream>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
......@@ -164,19 +162,19 @@ template< typename LatticeModel_T, class Enable = void >
struct StencilString;
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type >
{
static const char * str() { return "D3Q15"; }
};
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
{
static const char * str() { return "D3Q19"; }
};
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
{
static const char * str() { return "D3Q27"; }
};
......@@ -186,21 +184,21 @@ template< typename LatticeModel_T, class Enable = void >
struct CollisionModelString;
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::SRT_tag >::value >::type >
{
static const char * str() { return "SRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::TRT_tag >::value >::type >
{
static const char * str() { return "TRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >::value >::type >
{
static const char * str() { return "MRT"; }
......@@ -638,10 +636,10 @@ struct AddRefinementTimeStep
};
template< typename LatticeModel_T >
struct AddRefinementTimeStep< LatticeModel_T, typename boost::enable_if< boost::mpl::or_< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >,
boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >,
boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 > > >::type >
struct AddRefinementTimeStep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value ||
std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value ||
std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value
>::type >
{
static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks,
const BlockDataID & pdfFieldId, const BlockDataID & flagFieldId, const BlockDataID & boundaryHandlingId,
......
......@@ -79,6 +79,7 @@
#include <functional>
#include <iostream>
#include <memory>
#include <type_traits>
......@@ -136,7 +137,7 @@ template< typename LatticeModel_T, class Enable = void >
struct StencilString;
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
{
static const char * str() { return "D3Q19"; }
};
......@@ -145,21 +146,21 @@ template< typename LatticeModel_T, class Enable = void >
struct CollisionModelString;
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::SRT_tag >::value >::type >
{
static const char * str() { return "SRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::TRT_tag >::value >::type >
{
static const char * str() { return "TRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >::value >::type >
{
static const char * str() { return "MRT"; }
......@@ -647,7 +648,7 @@ struct AddRefinementTimeStep
};
template< typename LatticeModel_T >
struct AddRefinementTimeStep< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct AddRefinementTimeStep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >::value >::type >
{
static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks,
......
......@@ -96,6 +96,7 @@
#include <functional>
#include <iostream>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
......@@ -153,13 +154,13 @@ template< typename LatticeModel_T, class Enable = void >
struct StencilString;
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
{
static const char * str() { return "D3Q19"; }
};
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
{
static const char * str() { return "D3Q27"; }
};
......@@ -169,14 +170,14 @@ template< typename LatticeModel_T, class Enable = void >
struct CollisionModelString;
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::SRT_tag >::value >::type >
{
static const char * str() { return "SRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::TRT_tag >::value >::type >
{
static const char * str() { return "TRT"; }
......
......@@ -105,10 +105,6 @@
#include "vtk/Initialization.h"
#include "vtk/VTKOutput.h"
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/or.hpp>
#include <algorithm>
#include <cmath>
#include <cstdlib>
......@@ -116,6 +112,7 @@
#include <functional>
#include <iostream>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
......@@ -196,7 +193,7 @@ const Set<SUID> None( Set<SUID>::emptySet() );
template< typename LatticeModel_T >
struct Is2D
{
static const bool value = boost::mpl::equal_to< boost::mpl::int_< LatticeModel_T::Stencil::D >, boost::mpl::int_< 2 > >::value;
static const bool value = LatticeModel_T::Stencil::D == 2;
};
/////////////////////
......@@ -207,25 +204,25 @@ template< typename LatticeModel_T, class Enable = void >
struct StencilString;
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value >::type >
{
static const char * str() { return "D2Q9"; }
};
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type >
{
static const char * str() { return "D3Q15"; }
};
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
{
static const char * str() { return "D3Q19"; }
};
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
{
static const char * str() { return "D3Q27"; }
};
......@@ -235,21 +232,21 @@ template< typename LatticeModel_T, class Enable = void >
struct CollisionModelString;
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::SRT_tag >::value >::type >
{
static const char * str() { return "SRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::TRT_tag >::value >::type >
{
static const char * str() { return "TRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >::value >::type >
{
static const char * str() { return "MRT"; }
......@@ -2313,11 +2310,11 @@ struct AddRefinementTimeStep
};
template< typename LatticeModel_T >
struct AddRefinementTimeStep< LatticeModel_T, typename boost::enable_if< boost::mpl::or_< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >,
boost::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >,
boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >,
boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 > > >::type >
struct AddRefinementTimeStep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value ||
std::is_same< typename LatticeModel_T::Stencil, stencil::D2Q9 >::value ||
std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value ||
std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value
>::type >
{
static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks,
const BlockDataID & pdfFieldId, const BlockDataID & flagFieldId, const BlockDataID & boundaryHandlingId,
......
......@@ -143,14 +143,14 @@ template< typename LatticeModel_T, class Enable = void >
struct StencilString;
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type >
{
static const char * str() { return "D3Q19"; }
};
template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type >
{
static const char * str() { return "D3Q27"; }
};
......@@ -159,28 +159,28 @@ template< typename LatticeModel_T, class Enable = void >
struct CollisionModelString;
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::SRT_tag >::value >::type >
{
static const char * str() { return "SRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::TRT_tag >::value >::type >
{
static const char * str() { return "TRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >::value >::type >
{
static const char * str() { return "MRT"; }
};
template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename boost::enable_if_c< boost::is_same< typename LatticeModel_T::CollisionModel::tag,
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::Cumulant_tag >::value >::type >
{
static const char * str() { return "Cumulant"; }
......@@ -593,12 +593,9 @@ struct AddLB
};
template< typename LatticeModel_T >
struct AddLB< LatticeModel_T, typename boost::enable_if_c< boost::mpl::or_<
boost::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >,
boost::is_same< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::Cumulant_tag >
>::value >::type >
struct AddLB< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value ||
std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::Cumulant_tag >::value
>::type >
{
using PdfField = typename Types< LatticeModel_T >::PdfField_T;
using CommunicationStencil = typename Types< LatticeModel_T >::CommunicationStencil_T;
......
......@@ -37,6 +37,7 @@
#include <map>
#include <set>
#include <stack>
#include <type_traits>
#include <vector>
......@@ -176,7 +177,7 @@ private:
bool weightedBlocks() const
{
return ! boost::is_same< PhantomData_T, NoPhantomData >::value;
return ! std::is_same< PhantomData_T, NoPhantomData >::value;
}
template< typename T >
......
......@@ -34,6 +34,7 @@
#include <map>
#include <set>
#include <type_traits>
#include <vector>
......@@ -115,7 +116,7 @@ private:
double weight( const PhantomBlock * block ) const
{
return boost::is_same< PhantomData_T, NoPhantomData >::value ? 1.0 :
return std::is_same< PhantomData_T, NoPhantomData >::value ? 1.0 :
numeric_cast< double >( block->template getData< PhantomData_T >().weight() );
}
......
......@@ -26,8 +26,7 @@
#include "core/debug/Debug.h"
#include "core/DataTypes.h"
#include <boost/type_traits/is_unsigned.hpp>
#include <boost/utility/enable_if.hpp>
#include <type_traits>
namespace walberla {
namespace boundary {
......@@ -118,7 +117,7 @@ template< typename flag_t >
class Boundary {
public:
static_assert( boost::is_unsigned<flag_t>::value, "You are trying to instantiate walberla::boundary::Boundary with "
static_assert( std::is_unsigned<flag_t>::value, "You are trying to instantiate walberla::boundary::Boundary with "
"a flag_t which is not an unsigned integer!" );
#ifndef NDEBUG
......@@ -157,7 +156,7 @@ struct isThreadSafe
};
template< typename Boundary_T >
struct isThreadSafe< Boundary_T, typename boost::enable_if_c< Boundary_T::threadsafe >::type >
struct isThreadSafe< Boundary_T, typename std::enable_if< Boundary_T::threadsafe >::type >
{
static const bool value = Boundary_T::threadsafe;
};
......
......@@ -42,6 +42,7 @@
#include <boost/tuple/tuple.hpp>
#include <ostream>
#include <string>
#include <type_traits>
#include <vector>
......@@ -391,9 +392,9 @@ private:
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions,
typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0,
typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryConditions.get_head().getUID() )
return boundaryConditions.get_head();
......@@ -403,7 +404,7 @@ private:
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition( const BoundaryUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryConditions,
typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryConditions.get_head().getUID() )
return boundaryConditions.get_head();
......@@ -417,18 +418,18 @@ private:
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions,
typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type,
boost::false_type > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type,
std::false_type >::value >::type* /*dummy*/ = 0,
typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
return getBoundaryCondition< Boundary_T, typename Tail::head_type, typename Tail::tail_type >( uid, boundaryConditions.get_tail() );
}
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition( const BoundaryUID & /*uid*/, const boost::tuples::cons<Head, boost::tuples::null_type> & /*boundaryConditions*/,
typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
static_assert( sizeof(Boundary_T) == 0, "The requested boundary class is not part of this boundary handling." );
}
......@@ -443,9 +444,9 @@ private:
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions,
typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0,
typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryConditions.get_head().getUID() )
return boundaryConditions.get_head();
......@@ -455,7 +456,7 @@ private:
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryConditions,
typename boost::enable_if< boost::is_same< Boundary_T, Head > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< Boundary_T, Head >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryConditions.get_head().getUID() )
return boundaryConditions.get_head();
......@@ -469,18 +470,18 @@ private:
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, Tail> & boundaryConditions,
typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type,
boost::false_type > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type,
std::false_type >::value >::type* /*dummy*/ = 0,
typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
return getBoundaryCondition_TypeExists< Boundary_T, typename Tail::head_type, typename Tail::tail_type >( uid, boundaryConditions.get_tail() );
}
template< typename Boundary_T, typename Head, typename Tail >
inline const Boundary_T & getBoundaryCondition_TypeExists( const BoundaryUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & /*boundaryConditions*/,
typename boost::enable_if< boost::is_same< typename boost::is_same< Boundary_T, Head >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< typename std::is_same< Boundary_T, Head >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
WALBERLA_ABORT( "The requested boundary condition " << uid.getIdentifier() << " is not part of this boundary handling." );
......
......@@ -36,8 +36,10 @@
#include "field/FlagField.h"
#include <boost/tuple/tuple.hpp>
#include <ostream>
#include <string>
#include <type_traits>
#include <vector>
......@@ -251,9 +253,9 @@ private:
template< typename BoundaryHandling_T, typename Head, typename Tail >
inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers,
typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0,
typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryHandlers.get_head().getUID() )
return boundaryHandlers.get_head();
......@@ -264,7 +266,7 @@ private:
template< typename BoundaryHandling_T, typename Head, typename Tail >
inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryHandlers,
typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryHandlers.get_head().getUID() )
return boundaryHandlers.get_head();
......@@ -274,18 +276,18 @@ private:
template< typename BoundaryHandling_T, typename Head, typename Tail >
inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers,
typename boost::enable_if< boost::is_same< typename boost::is_same< BoundaryHandling_T, Head >::type,
boost::false_type > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< typename std::is_same< BoundaryHandling_T, Head >::type,
std::false_type >::value >::type* /*dummy*/ = 0,
typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
return getBoundaryHandling< BoundaryHandling_T, typename Tail::head_type, typename Tail::tail_type >( uid, boundaryHandlers.get_tail() );
}
template< typename BoundaryHandling_T, typename Head, typename Tail >
inline const BoundaryHandling_T & getBoundaryHandling( const BoundaryHandlingUID & /*uid*/, const boost::tuples::cons<Head, boost::tuples::null_type> & /*boundaryHandlers*/,
typename boost::enable_if< boost::is_same< typename boost::is_same< BoundaryHandling_T, Head >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< typename std::is_same< BoundaryHandling_T, Head >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
static_assert( sizeof(BoundaryHandling_T) == 0, "The requested boundary handling is not part of this boundary handling collection." );
}
......@@ -300,9 +302,9 @@ private:
template< typename BoundaryHandling_T, typename Head, typename Tail >
inline const BoundaryHandling_T & getBoundaryHandling_TypeExists( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers,
typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0,
typename std::enable_if< std::is_same< typename std::is_same< Tail, boost::tuples::null_type >::type,
std::false_type >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryHandlers.get_head().getUID() )
return boundaryHandlers.get_head();
......@@ -313,7 +315,7 @@ private:
template< typename BoundaryHandling_T, typename Head, typename Tail >
inline const BoundaryHandling_T & getBoundaryHandling_TypeExists( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, boost::tuples::null_type> & boundaryHandlers,
typename boost::enable_if< boost::is_same< BoundaryHandling_T, Head > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< BoundaryHandling_T, Head >::value >::type* /*dummy*/ = 0 ) const
{
if( uid == boundaryHandlers.get_head().getUID() )
return boundaryHandlers.get_head();
......@@ -323,18 +325,18 @@ private:
template< typename BoundaryHandling_T, typename Head, typename Tail >
inline const BoundaryHandling_T & getBoundaryHandling_TypeExists( const BoundaryHandlingUID & uid, const boost::tuples::cons<Head, Tail> & boundaryHandlers,
typename boost::enable_if< boost::is_same< typename boost::is_same< BoundaryHandling_T, Head >::type,
boost::false_type > >::type* /*dummy*/ = 0,
typename boost::enable_if< boost::is_same< typename boost::is_same< Tail, boost::tuples::null_type >::type,
boost::false_type > >::type* /*dummy*/ = 0 ) const
typename std::enable_if< std::is_same< typename std::is_same< BoundaryHandling_T, Head >::type,
std::false_type >::value >::type* /*dummy*/ = 0