Commit 8b5cc911 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Specialization of MeshEntityTopology needs MeshDimensionsTag

The problem is that non-type template parameters in specialization
cannot depend on other parameters. No idea why g++ does not complain,
but clang does.
parent c8112e12
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public:

   using GlobalIndexType               = typename MeshConfig::GlobalIndexType;
   using LocalIndexType                = typename MeshConfig::LocalIndexType;
   using EntityTopology                = typename MeshEntityTopology< MeshConfig, Dimensions >::Topology;
   using EntityTopology                = typename MeshEntityTopology< MeshConfig, MeshDimensionsTag< Dimensions > >::Topology;

   using EntityType                    = MeshEntity< MeshConfig, EntityTopology >;
   using SeedType                      = MeshEntitySeed< MeshConfig, EntityTopology >;
+6 −4
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#pragma once

#include <TNL/Meshes/MeshDimensionsTag.h>

namespace TNL {
namespace Meshes{

@@ -33,15 +35,15 @@ struct tnlSubentityVertex;


template< typename MeshConfig,
          int Dimensions >
          typename DimensionsTag >
struct MeshEntityTopology
{
   static_assert( Dimensions <= MeshConfig::meshDimensions, "There are no entities with dimension higher than the mesh dimension." );
   using Topology = typename MeshSubtopology< typename MeshConfig::CellTopology, Dimensions >::Topology;
   static_assert( DimensionsTag::value <= MeshConfig::meshDimensions, "There are no entities with dimension higher than the mesh dimension." );
   using Topology = typename MeshSubtopology< typename MeshConfig::CellTopology, DimensionsTag::value >::Topology;
};

template< typename MeshConfig >
struct MeshEntityTopology< MeshConfig, MeshConfig::CellTopology::dimensions >
struct MeshEntityTopology< MeshConfig, MeshDimensionsTag< MeshConfig::CellTopology::dimensions > >
{
   using Topology = typename MeshConfig::CellTopology;
};