Commit 122c4d37 authored by Felix Gruber's avatar Felix Gruber

[cleanup] use std:: implementation of remove_reference

parent 535ec6b6
......@@ -49,8 +49,8 @@ namespace Dune {
static void apply(N&& n, V&& v, TreePath tp)
{
// make sure we do not try to work with references to the actual types
typedef typename remove_reference<N>::type Node;
typedef typename remove_reference<V>::type Visitor;
typedef typename std::remove_reference<N>::type Node;
typedef typename std::remove_reference<V>::type Visitor;
// get child type
typedef typename Node::template Child<count-inverse_k>::Type C;
......@@ -92,8 +92,8 @@ namespace Dune {
template<typename N, typename V, typename TreePath>
static void apply(N&& n, V&& v, TreePath tp)
{
typedef typename remove_reference<N>::type Node;
typedef typename remove_reference<V>::type Visitor;
typedef typename std::remove_reference<N>::type Node;
typedef typename std::remove_reference<V>::type Visitor;
typedef typename Node::template Child<count-1>::Type C;
typedef typename TreePathPushBack<TreePath,count-1>::type ChildTreePath;
const bool visit = Visitor::template VisitChild<Node,C,ChildTreePath>::value;
......@@ -130,8 +130,8 @@ namespace Dune {
template<typename N, typename V, typename TreePath>
static void apply(N&& n, V&& v, TreePath tp)
{
typedef typename remove_reference<N>::type Node;
typedef typename remove_reference<V>::type Visitor;
typedef typename std::remove_reference<N>::type Node;
typedef typename std::remove_reference<V>::type Visitor;
typedef typename Node::template Child<count-inverse_k>::Type C;
const bool visit = Visitor::template VisitChild<Node,C,typename TreePath::ViewType>::value;
v.beforeChild(std::forward<N>(n),n.template child<count-inverse_k>(),tp.view(),count-inverse_k);
......@@ -158,8 +158,8 @@ namespace Dune {
template<typename N, typename V, typename TreePath>
static void apply(N&& n, V&& v, TreePath tp)
{
typedef typename remove_reference<N>::type Node;
typedef typename remove_reference<V>::type Visitor;
typedef typename std::remove_reference<N>::type Node;
typedef typename std::remove_reference<V>::type Visitor;
typedef typename Node::template Child<count-1>::Type C;
const bool visit = Visitor::template VisitChild<Node,C,typename TreePath::ViewType>::value;
v.beforeChild(std::forward<N>(n),n.template child<count-1>(),tp.view(),count-1);
......@@ -217,8 +217,8 @@ namespace Dune {
static void apply(N&& n, V&& v, TreePath tp)
{
v.pre(std::forward<N>(n),tp);
typedef typename remove_reference<N>::type Node;
typedef typename remove_reference<V>::type Visitor;
typedef typename std::remove_reference<N>::type Node;
typedef typename std::remove_reference<V>::type Visitor;
apply_to_children<Visitor::treePathType,Node::CHILDREN>::apply(std::forward<N>(n),
std::forward<V>(v),
tp);
......
......@@ -38,13 +38,13 @@ namespace Dune {
template<typename N1, typename N2, typename V, typename TreePath>
static void apply(N1&& n1, N2&& n2, V&& v, TreePath tp)
{
typedef typename remove_reference<N1>::type::template Child<count-inverse_k>::Type C1;
typedef typename remove_reference<N2>::type::template Child<count-inverse_k>::Type C2;
typedef typename std::remove_reference<N1>::type::template Child<count-inverse_k>::Type C1;
typedef typename std::remove_reference<N2>::type::template Child<count-inverse_k>::Type C2;
typedef typename TreePathPushBack<TreePath,count-inverse_k>::type ChildTreePath;
const bool visit = std::remove_reference<V>::type
::template VisitChild<typename remove_reference<N1>::type,
::template VisitChild<typename std::remove_reference<N1>::type,
C1,
typename remove_reference<N2>::type,
typename std::remove_reference<N2>::type,
C2,
ChildTreePath>::value;
v.beforeChild(std::forward<N1>(n1),n1.template child<count-inverse_k>(),
......@@ -78,13 +78,13 @@ namespace Dune {
template<typename N1, typename N2, typename V, typename TreePath>
static void apply(N1&& n1, N2&& n2, V&& v, TreePath tp)
{
typedef typename remove_reference<N1>::type::template Child<count-1>::Type C1;
typedef typename remove_reference<N2>::type::template Child<count-1>::Type C2;
typedef typename std::remove_reference<N1>::type::template Child<count-1>::Type C1;
typedef typename std::remove_reference<N2>::type::template Child<count-1>::Type C2;
typedef typename TreePathPushBack<TreePath,count-1>::type ChildTreePath;
const bool visit = std::remove_reference<V>::type
::template VisitChild<typename remove_reference<N1>::type,
::template VisitChild<typename std::remove_reference<N1>::type,
C1,
typename remove_reference<N2>::type,
typename std::remove_reference<N2>::type,
C2,
ChildTreePath>::value;
v.beforeChild(std::forward<N1>(n1),n1.template child<count-1>(),
......@@ -126,12 +126,12 @@ namespace Dune {
template<typename N1, typename N2, typename V, typename TreePath>
static void apply(N1&& n1, N2&& n2, V&& v, TreePath tp)
{
typedef typename remove_reference<N1>::type::template Child<count-inverse_k>::Type C1;
typedef typename remove_reference<N2>::type::template Child<count-inverse_k>::Type C2;
typedef typename std::remove_reference<N1>::type::template Child<count-inverse_k>::Type C1;
typedef typename std::remove_reference<N2>::type::template Child<count-inverse_k>::Type C2;
const bool visit = std::remove_reference<V>::type
::template VisitChild<typename remove_reference<N1>::type,
::template VisitChild<typename std::remove_reference<N1>::type,
C1,
typename remove_reference<N2>::type,
typename std::remove_reference<N2>::type,
C2,
typename TreePath::ViewType>::value;
v.beforeChild(std::forward<N1>(n1),n1.template child<count-inverse_k>(),
......@@ -167,12 +167,12 @@ namespace Dune {
template<typename N1, typename N2, typename V, typename TreePath>
static void apply(N1&& n1, N2&& n2, V&& v, TreePath tp)
{
typedef typename remove_reference<N1>::type::template Child<count-1>::Type C1;
typedef typename remove_reference<N2>::type::template Child<count-1>::Type C2;
typedef typename std::remove_reference<N1>::type::template Child<count-1>::Type C1;
typedef typename std::remove_reference<N2>::type::template Child<count-1>::Type C2;
const bool visit = std::remove_reference<V>::type
::template VisitChild<typename remove_reference<N1>::type,
::template VisitChild<typename std::remove_reference<N1>::type,
C1,
typename remove_reference<N2>::type,
typename std::remove_reference<N2>::type,
C2,
typename TreePath::ViewType>::value;
v.beforeChild(std::forward<N1>(n1),n1.template child<count-1>(),
......@@ -230,7 +230,7 @@ namespace Dune {
// one node is a leaf -> treat node pair as a leaf
template<typename N1, typename N2, typename V, typename TreePath>
static typename std::enable_if<(remove_reference<N1>::type::isLeaf || remove_reference<N2>::type::isLeaf)>::type
static typename std::enable_if<(std::remove_reference<N1>::type::isLeaf || std::remove_reference<N2>::type::isLeaf)>::type
apply(N1&& n1, N2&& n2, V&& v, TreePath tp)
{
v.leaf(std::forward<N1>(n1),std::forward<N2>(n2),tp.view());
......@@ -238,12 +238,12 @@ namespace Dune {
// both nodes contain children -> iterate over them
template<typename N1, typename N2, typename V, typename TreePath>
static typename std::enable_if<!(remove_reference<N1>::type::isLeaf || remove_reference<N2>::type::isLeaf)>::type
static typename std::enable_if<!(std::remove_reference<N1>::type::isLeaf || std::remove_reference<N2>::type::isLeaf)>::type
apply(N1&& n1, N2&& n2, V&& v, TreePath tp)
{
v.pre(std::forward<N1>(n1),std::forward<N2>(n2),tp.view());
typedef typename remove_reference<N1>::type Node1;
typedef typename remove_reference<N2>::type Node2;
typedef typename std::remove_reference<N1>::type Node1;
typedef typename std::remove_reference<N2>::type Node2;
// make sure both nodes have the same number of children - otherwise, it
// would be difficult to match the children to each other.
static_assert(Node1::CHILDREN == Node2::CHILDREN,
......
......@@ -27,8 +27,8 @@ namespace Dune {
static void apply(Node1&& node1, Node2&& node2, Visitor&& visitor)
{
ApplyToTreePair<tpType,
typename remove_reference<Node1>::type::NodeTag,
typename remove_reference<Node2>::type::NodeTag
typename std::remove_reference<Node1>::type::NodeTag,
typename std::remove_reference<Node2>::type::NodeTag
>::apply(std::forward<Node1>(node1),
std::forward<Node2>(node2),
std::forward<Visitor>(visitor),
......@@ -116,8 +116,8 @@ namespace Dune {
static void apply(N1&& n1, N2&& n2, V&& v, TreePath tp)
{
v.pre(std::forward<N1>(n1),std::forward<N2>(n2),tp.view());
typedef typename remove_reference<N1>::type Node1;
typedef typename remove_reference<N2>::type Node2;
typedef typename std::remove_reference<N1>::type Node1;
typedef typename std::remove_reference<N2>::type Node2;
typedef typename Node1::template Child<0>::Type C1;
typedef typename Node2::template Child<0>::Type C2;
static_assert(Node1::CHILDREN == Node2::CHILDREN,
......
......@@ -32,7 +32,7 @@ namespace Dune {
template<typename T, typename It, typename Arg, typename... Args>
void assign_reference_pack_to_shared_ptr_array_unpack(It it, Arg&& arg, Args&&... args)
{
static_assert(is_same<T,typename remove_const<typename remove_reference<Arg>::type>::type>::value,"type mismatch during array conversion");
static_assert(is_same<T,typename std::remove_const<typename std::remove_reference<Arg>::type>::type>::value,"type mismatch during array conversion");
*it = convert_arg(std::forward<Arg>(arg));
assign_reference_pack_to_shared_ptr_array_unpack<T>(++it,std::forward<Args>(args)...);
}
......
......@@ -38,7 +38,7 @@ namespace Dune {
template<typename Node, typename Visitor>
static void apply(Node&& node, Visitor&& visitor)
{
ApplyToTree<tpType,typename remove_reference<Node>::type::NodeTag>::apply(std::forward<Node>(node),
ApplyToTree<tpType,typename std::remove_reference<Node>::type::NodeTag>::apply(std::forward<Node>(node),
std::forward<Visitor>(visitor),
TreePathFactory<tpType>::create(node).mutablePath());
}
......@@ -106,8 +106,8 @@ namespace Dune {
v.pre(std::forward<N>(n),tp.view());
// strip types of possible references
typedef typename remove_reference<N>::type Node;
typedef typename remove_reference<V>::type Visitor;
typedef typename std::remove_reference<N>::type Node;
typedef typename std::remove_reference<V>::type Visitor;
// get child type
typedef typename Node::template Child<0>::Type C;
......
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