Commit 23df0b03 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'feature/std_void_t' into 'master'

use std::void_t instead of Dune::void_t

See merge request !175
parents 518dbbcf 095370dd
......@@ -10,7 +10,7 @@ namespace AMDiS
{
namespace Impl
{
template <class E, class = Dune::void_t<>>
template <class E, class = std::void_t<>>
struct ContextTypes
{
using Entity = E;
......@@ -19,7 +19,7 @@ namespace AMDiS
// specialization for intersections
template <class I>
struct ContextTypes<I, Dune::void_t<decltype(std::declval<I>().inside())>>
struct ContextTypes<I, std::void_t<decltype(std::declval<I>().inside())>>
{
using Entity = typename I::Entity;
using LocalGeometry = typename I::LocalGeometry;
......
......@@ -20,19 +20,17 @@
namespace AMDiS
{
using Dune::void_t;
namespace Concepts
{
namespace Impl_
{
template <class Concept, class = void_t<>>
template <class Concept, class = std::void_t<>>
struct models
: std::false_type
{};
template <class Concept, class... Ts>
struct models<Concept(Ts...), void_t< decltype(std::declval<Concept>().require(std::declval<Ts>()...)) >>
struct models<Concept(Ts...), std::void_t< decltype(std::declval<Concept>().require(std::declval<Ts>()...)) >>
: std::true_type
{};
......
......@@ -36,7 +36,7 @@ namespace Dune
namespace AMDiS
{
// forward declaration
template <class PreBasis, class TP, class = void>
template <class PreBasis, class TP, class NodeTag = typename Node_t<PreBasis,TP>::NodeTag>
class NodeIdSet;
/// \brief Type of a global used used to represent DOFs uniquely
......@@ -102,7 +102,7 @@ namespace AMDiS
* ```
*
**/
template <class GB, class = void>
template <class GB, class = std::void_t<> >
class GlobalBasisIdSet
{
public:
......@@ -192,7 +192,7 @@ namespace AMDiS
// Specialization for SubspaceBasis
template <class Basis>
class GlobalBasisIdSet<Basis, void_t<typename Basis::RootBasis>>
class GlobalBasisIdSet<Basis, std::void_t<typename Basis::RootBasis>>
: public GlobalBasisIdSet<typename Basis::RootBasis>
{
public:
......@@ -202,7 +202,7 @@ namespace AMDiS
};
template <class PB, class TP, class>
template <class PB, class TP, class NodeTag>
class NodeIdSet
{
public:
......@@ -284,7 +284,7 @@ namespace AMDiS
// Specialization for PowerBasis
template <class PreBasis, class TP>
class NodeIdSet<PreBasis, TP, void_t<typename PreBasis::SubPreBasis>>
class NodeIdSet<PreBasis, TP, Dune::TypeTree::PowerNodeTag>
{
public:
using Node = Node_t<PreBasis,TP>;
......@@ -344,7 +344,7 @@ namespace AMDiS
// Specialization for CompositePreBasis
template <class PreBasis, class TP>
class NodeIdSet<PreBasis, TP, void_t<typename PreBasis::SubPreBases>>
class NodeIdSet<PreBasis, TP, Dune::TypeTree::CompositeNodeTag>
{
public:
using Node = Node_t<PreBasis,TP>;
......@@ -420,7 +420,7 @@ namespace AMDiS
template <class GV, class MI, bool HI, class TP>
class NodeIdSet<Dune::Functions::TaylorHoodPreBasis<GV,MI,HI>, TP>
class NodeIdSet<Dune::Functions::TaylorHoodPreBasis<GV,MI,HI>, TP, Dune::TypeTree::CompositeNodeTag>
{
public:
using PreBasis = Dune::Functions::TaylorHoodPreBasis<GV,MI,HI>;
......
......@@ -10,9 +10,9 @@ namespace AMDiS
{
/// The derivative of a localfunction as localfunction itself
template <class LocalFunction, class Type,
REQUIRES(std::is_convertible_v<tag::derivative_type, Type>),
class = void_t<decltype(std::declval<LocalFunction>().makeDerivative(std::declval<Type>()))> >
REQUIRES(std::is_convertible_v<tag::derivative_type, Type>)>
auto derivative(LocalFunction const& lf, Type const& type)
-> decltype(lf.makeDerivative(type))
{
return lf.makeDerivative(type);
}
......
......@@ -40,7 +40,7 @@ namespace AMDiS
/// A Generator for a mutable \ref DiscreteFunction
template <class Coeff, class GB, class Path = RootTreePath,
class = void_t<decltype(std::declval<GB>().localView())> >
class = std::void_t<decltype(std::declval<GB>().localView())> >
auto makeDiscreteFunction(Coeff& coefficients, GB const& basis, Path const& path = {})
{
return DiscreteFunction<Coeff, GB, TreePath_t<Path>>{coefficients, basis, path};
......
#pragma once
#include <type_traits>
#include <dune/common/typeutilities.hh>
#include <amdis/common/Concepts.hpp>
......@@ -10,9 +12,9 @@
namespace AMDiS
{
// The localFunction of a GridFunction
template <class GridFunction,
class = void_t<decltype(std::declval<GridFunction>().makeLocalFunction())> >
template <class GridFunction>
auto localFunction(GridFunction const& gf)
-> decltype(gf.makeLocalFunction())
{
return gf.makeLocalFunction();
}
......@@ -46,7 +48,7 @@ namespace AMDiS
struct HasGridFunctionTypes
{
template <class GF>
auto require(GF const& /*gf*/) -> void_t<
auto require(GF const& /*gf*/) -> std::void_t<
typename GF::Range,
typename GF::Domain,
typename GF::EntitySet
......
#pragma once
#include <type_traits>
#include <amdis/common/Concepts.hpp>
namespace AMDiS
{
// polynomial order of local functions
template <class LocalFunction,
class = void_t<decltype(std::declval<LocalFunction>().order())> >
int order(LocalFunction const& lf)
template <class LocalFunction>
auto order(LocalFunction const& lf)
-> decltype(lf.order())
{
return lf.order();
}
......
......@@ -60,7 +60,7 @@ namespace AMDiS
/// Constructor. Forwards the basis to the implementation class and
/// constructs a (type-erased) size-info object.
template <class GlobalBasis,
class = void_t<decltype(std::declval<GlobalBasis>().dimension())> >
class = std::void_t<decltype(std::declval<GlobalBasis>().dimension())> >
VectorFacade(GlobalBasis const& basis)
: impl_(basis)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment