#pragma once #include #include #include namespace AMDiS { namespace Traits { template struct IsValidTreePath; // empty treepath template struct IsValidTreePath, NodeTag> : std::true_type {}; // leaf nodes template struct IsValidTreePath, Dune::TypeTree::LeafNodeTag> : std::false_type {}; // power nodes template struct IsValidTreePath, Dune::TypeTree::PowerNodeTag> : IsValidTreePath> {}; // composite node with integer index template struct IsValidTreePath, Dune::TypeTree::CompositeNodeTag> : std::false_type {}; // composite node with integral-constant index template struct IsValidTreePath,II...>, Dune::TypeTree::CompositeNodeTag> : std::conditional_t<(i >= 0 && i < Tree::degree()), IsValidTreePath= 0 && i < Tree::degree()) ? i : 0>::Type, Dune::TypeTree::HybridTreePath>, std::false_type> {}; } // end namespace Traits namespace Concepts { /// \brief Check whether `Path` is a valid index of treepath for the given typetree `Tree` template static constexpr bool ValidTreePath = Traits::IsValidTreePath()))>::value; } } // end namespace AMDiS