Commit 4883203c authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Refactored enable_if_type into the main TypeTraits.h file

parent 8c2688a6
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -92,9 +92,6 @@ using EnableIfDistributedBinaryExpression_t = std::enable_if_t<


// helper trait class for recursively turning expression template classes into compatible vectors
template<class T, class R = void>
struct enable_if_type { typedef R type; };

template< typename R, typename Enable = void >
struct RemoveExpressionTemplate
{
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ struct HasMeshType
{};

template< typename T >
struct HasMeshType< T, typename Containers::Expressions::enable_if_type< typename T::MeshType >::type >
struct HasMeshType< T, typename enable_if_type< typename T::MeshType >::type >
: public std::true_type
{};

+1 −8
Original line number Diff line number Diff line
@@ -12,8 +12,7 @@

#pragma once

#include <type_traits>

#include <TNL/TypeTraits.h>
#include <TNL/Meshes/MeshEntity.h>

namespace TNL {
@@ -22,12 +21,6 @@ namespace Writers {

namespace details {

template< typename T, typename R = void >
struct enable_if_type
{
   using type = R;
};

template< typename T, typename Enable = void >
struct has_entity_topology : std::false_type {};

+6 −0
Original line number Diff line number Diff line
@@ -15,6 +15,12 @@

namespace TNL {

template< typename T, typename R = void >
struct enable_if_type
{
   using type = R;
};

/**
 * \brief Type trait for checking if T has getArrayData method.
 */