Commit c2c914c6 authored by Steffen Müthing's avatar Steffen Müthing

Merge branch 'type_traits' into 'master'

FS#1512 Replace type traits by their standard versions

See core/dune-common!27 for more information.

See merge request !7
parents 78104bb9 d28e8073
......@@ -351,7 +351,7 @@ namespace Dune {
flattened_reduction
>
{
typedef typename Dune::conditional<
typedef typename std::conditional<
TreePathBack<tree_path>::value == 0,
start_type,
current_type
......
......@@ -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;
......@@ -62,7 +62,7 @@ namespace Dune {
const bool visit = Visitor::template VisitChild<Node,C,ChildTreePath>::value;
// beforeChild() gets called regardless of the value of visit
v.beforeChild(std::forward<N>(n),n.template child<count-inverse_k>(),tp,integral_constant<std::size_t,count-inverse_k>());
v.beforeChild(std::forward<N>(n),n.template child<count-inverse_k>(),tp,std::integral_constant<std::size_t,count-inverse_k>());
// traverse to child
ApplyToTree<Visitor::treePathType,typename C::NodeTag,visit>::apply(n.template child<count-inverse_k>(),
......@@ -70,7 +70,7 @@ namespace Dune {
ChildTreePath());
// afterChild() gets called regardless of the value of visit
v.afterChild(std::forward<N>(n),n.template child<count-inverse_k>(),tp,integral_constant<std::size_t,count-inverse_k>());
v.afterChild(std::forward<N>(n),n.template child<count-inverse_k>(),tp,std::integral_constant<std::size_t,count-inverse_k>());
// we are not at the last child (that is specialized), so call infix visitor callback
v.in(std::forward<N>(n),tp);
......@@ -92,16 +92,16 @@ 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;
v.beforeChild(std::forward<N>(n),n.template child<count-1>(),tp,integral_constant<std::size_t,count-1>());
v.beforeChild(std::forward<N>(n),n.template child<count-1>(),tp,std::integral_constant<std::size_t,count-1>());
ApplyToTree<Visitor::treePathType,typename C::NodeTag,visit>::apply(n.template child<count-1>(),
std::forward<V>(v),
ChildTreePath());
v.afterChild(std::forward<N>(n),n.template child<count-1>(),tp,integral_constant<std::size_t,count-1>());
v.afterChild(std::forward<N>(n),n.template child<count-1>(),tp,std::integral_constant<std::size_t,count-1>());
}
};
......@@ -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,18 +38,18 @@ 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>(),
std::forward<N2>(n2),n2.template child<count-inverse_k>(),
tp,integral_constant<std::size_t,count-inverse_k>());
tp,std::integral_constant<std::size_t,count-inverse_k>());
ApplyToTreePair<std::remove_reference<V>::type::treePathType,
typename C1::NodeTag,
typename C2::NodeTag,
......@@ -59,7 +59,7 @@ namespace Dune {
ChildTreePath());
v.afterChild(std::forward<N1>(n1),n1.template child<count-inverse_k>(),
std::forward<N2>(n2),n2.template child<count-inverse_k>(),
tp,integral_constant<std::size_t,count-inverse_k>());
tp,std::integral_constant<std::size_t,count-inverse_k>());
v.in(std::forward<N1>(n1),std::forward<N2>(n2),tp);
apply_to_children_pair_fully_static<inverse_k-1,count>::apply(std::forward<N1>(n1),
std::forward<N2>(n2),
......@@ -78,18 +78,18 @@ 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>(),
std::forward<N2>(n2),n2.template child<count-1>(),
tp,integral_constant<std::size_t,count-1>());
tp,std::integral_constant<std::size_t,count-1>());
ApplyToTreePair<std::remove_reference<V>::type::treePathType,
typename C1::NodeTag,
typename C2::NodeTag,
......@@ -99,7 +99,7 @@ namespace Dune {
ChildTreePath());
v.afterChild(std::forward<N1>(n1),n1.template child<count-1>(),
std::forward<N2>(n2),n2.template child<count-1>(),
tp,integral_constant<std::size_t,count-1>());
tp,std::integral_constant<std::size_t,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 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 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,
......
......@@ -138,7 +138,7 @@ namespace Dune {
// ********************************************************************************
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
(TypeTree::TreePathSize<TreePath>::value > 1),
typename extract_child_type<Node,TreePath>::type&
>::type
......@@ -149,7 +149,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 1,
typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>::Type&
>::type
......@@ -159,7 +159,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 0,
Node&
>::type
......@@ -173,7 +173,7 @@ namespace Dune {
// ********************************************************************************
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
(TypeTree::TreePathSize<TreePath>::value > 1),
const typename extract_child_type<Node,TreePath>::type&
>::type
......@@ -184,7 +184,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 1,
const typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>::Type&
>::type
......@@ -194,7 +194,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 0,
const Node&
>::type
......@@ -275,7 +275,7 @@ namespace Dune {
// ********************************************************************************
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
(TypeTree::TreePathSize<TreePath>::value > 1),
typename extract_child_type<Node,TreePath>::storage_type
>::type
......@@ -286,7 +286,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 1,
typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>::Storage&
>::type
......@@ -296,7 +296,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 0
>::type
extract_child_storage(Node& node, TreePath tp)
......@@ -310,7 +310,7 @@ namespace Dune {
// ********************************************************************************
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
(TypeTree::TreePathSize<TreePath>::value > 1),
typename extract_child_type<Node,TreePath>::const_storage_type
>::type
......@@ -321,7 +321,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 1,
typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>::ConstStorage
>::type
......@@ -331,7 +331,7 @@ namespace Dune {
}
template<typename Node, typename TreePath>
typename enable_if<
typename std::enable_if<
TypeTree::TreePathSize<TreePath>::value == 0
>::type
extract_child_storage(const Node& node, TreePath tp)
......@@ -370,8 +370,8 @@ namespace Dune {
// level succeeds; otherwise, we would swamp the user with error messages as the algorithm
// walks down the remaining indices
//
// This struct gets created inside an enable_if, but the nested alias template that triggers
// the recursion is only instantiated if the enable_if was successful.
// This struct gets created inside an std::enable_if, but the nested alias template that triggers
// the recursion is only instantiated if the std::enable_if was successful.
template<typename Node>
struct _lazy_static_decltype
{
......@@ -384,7 +384,7 @@ namespace Dune {
// The actual implementation is rather simple, we just use an overload that requires the first index
// to be an index_constant, get the child and then recurse.
// It only gets ugly due to the enable_if, but without that trick, the error messages for the user
// It only gets ugly due to the std::enable_if, but without that trick, the error messages for the user
// can get *very* obscure (they are bad enough as it is, concepts where are you?).
template<typename Node, std::size_t i, typename... J>
auto child(Node&& node, index_constant<i>, J... j) ->
......
......@@ -224,7 +224,7 @@ namespace Dune {
{}
//! Initialize all children with the passed-in objects.
template<typename... Args, typename = typename enable_if<(sizeof...(Args) == CHILDREN)>::type>
template<typename... Args, typename = typename std::enable_if<(sizeof...(Args) == CHILDREN)>::type>
CompositeNode(Args&&... args)
: _children(convert_arg(std::forward<Args>(args))...)
{}
......
......@@ -6,6 +6,7 @@
#include <memory>
#include <tuple>
#include <type_traits>
#include <dune/typetree/nodetags.hh>
#include <dune/typetree/filters.hh>
......@@ -82,7 +83,7 @@ namespace Dune {
typedef typename filter::template apply<Node,typename Node::ChildTypes>::type filter_result;
typedef typename filter_result::template apply<Node> mapped_children;
static const bool nodeIsConst = IsConst<typename remove_reference<Node>::type>::value;
static const bool nodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
template<std::size_t k>
struct lazy_enable
......@@ -146,7 +147,7 @@ namespace Dune {
* \returns a reference to the i-th child.
*/
template<std::size_t k>
typename enable_if<lazy_enable<k>::value,typename Child<k>::Type&>::type
typename std::enable_if<lazy_enable<k>::value,typename Child<k>::Type&>::type
child()
{
return _node->template child<Child<k>::mapped_index>();
......@@ -167,7 +168,7 @@ namespace Dune {
* \returns a copy of the object storing the i-th child.
*/
template<std::size_t k>
typename enable_if<lazy_enable<k>::value,typename Child<k>::Storage>::type
typename std::enable_if<lazy_enable<k>::value,typename Child<k>::Storage>::type
childStorage()
{
return _node->template childStorage<Child<k>::mapped_index>();
......@@ -188,14 +189,14 @@ namespace Dune {
//! Sets the i-th child to the passed-in value.
template<std::size_t k>
void setChild(typename Child<k>::type& child, typename enable_if<lazy_enable<k>::value,void*>::type = 0)
void setChild(typename Child<k>::type& child, typename std::enable_if<lazy_enable<k>::value,void*>::type = 0)
{
_node->template childStorage<Child<k>::mapped_index>() = stackobject_to_shared_ptr(child);
}
//! Sets the storage of the i-th child to the passed-in value.
template<std::size_t k>
void setChild(typename Child<k>::storage_type child, typename enable_if<lazy_enable<k>::value,void*>::type = 0)
void setChild(typename Child<k>::storage_type child, typename std::enable_if<lazy_enable<k>::value,void*>::type = 0)
{
_node->template childStorage<Child<k>::mapped_index>() = child;
}
......@@ -212,7 +213,7 @@ namespace Dune {
* \returns A reference to the original, unfiltered node.
*/
template<bool enabled = !nodeIsConst>
typename enable_if<enabled,Node&>::type
typename std::enable_if<enabled,Node&>::type
unfiltered()
{
return *_node;
......@@ -232,7 +233,7 @@ namespace Dune {
* \returns A shared_ptr to the original, unfiltered node.
*/
template<bool enabled = !nodeIsConst>
typename enable_if<enabled,std::shared_ptr<Node> >::type
typename std::enable_if<enabled,std::shared_ptr<Node> >::type
unfilteredStorage()
{
return _node;
......
......@@ -194,10 +194,10 @@ namespace Dune {
template<typename... FilterDescriptors>
struct apply
: public Dune::conditional<Filter::template apply<child,new_k,old_k>::value,
typename filter_helper<Filter,new_k+1,old_k+1,tail...>::template apply<FilterDescriptors...,FilterEntry<new_k,old_k> >,
typename filter_helper<Filter,new_k,old_k+1,tail...>::template apply<FilterDescriptors...>
>::type
: public std::conditional<Filter::template apply<child,new_k,old_k>::value,
typename filter_helper<Filter,new_k+1,old_k+1,tail...>::template apply<FilterDescriptors...,FilterEntry<new_k,old_k> >,
typename filter_helper<Filter,new_k,old_k+1,tail...>::template apply<FilterDescriptors...>
>::type
{};
};
......
......@@ -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(std::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)...);
}
......@@ -52,7 +52,7 @@ namespace Dune {
template<typename T, typename It, typename Arg, typename... Args>
void assign_shared_ptr_pack_to_shared_ptr_array_unpack(It it, Arg&& arg, Args&&... args)
{
static_assert(is_same<T,typename std::remove_reference<Arg>::type::element_type>::value,"type mismatch during array conversion");
static_assert(std::is_same<T,typename std::remove_reference<Arg>::type::element_type>::value,"type mismatch during array conversion");
*it = arg;
assign_shared_ptr_pack_to_shared_ptr_array_unpack<T>(++it,args...);
}
......@@ -73,7 +73,7 @@ namespace Dune {
//! Helper struct to make constructor enabling mechanism in PowerNode more readable.
template<typename PowerNode, typename T, std::size_t k>
struct AssertPowerNodeChildCount
: public enable_if<is_same<
: public std::enable_if<std::is_same<
typename PowerNode::ChildType,
T>::value &&
PowerNode::CHILDREN == k,
......
......@@ -4,6 +4,7 @@
#ifndef DUNE_TYPETREE_PROXYNODE_HH
#define DUNE_TYPETREE_PROXYNODE_HH
#include <type_traits>
#include <dune/typetree/nodetags.hh>
#include <dune/common/shared_ptr.hh>
......@@ -23,7 +24,7 @@ namespace Dune {
class StaticChildAccessors
{
static const bool proxiedNodeIsConst = IsConst<typename remove_reference<ProxiedNode>::type>::value;
static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
template<std::size_t k>
struct lazy_enabled
......@@ -34,7 +35,7 @@ namespace Dune {
typedef ProxyNode<ProxiedNode> Node;
template<bool enabled = !proxiedNodeIsConst>
typename enable_if<enabled,Node&>::type
typename std::enable_if<enabled,Node&>::type
node()
{
return static_cast<Node&>(*this);
......@@ -61,7 +62,7 @@ namespace Dune {
* \returns a reference to the i-th child.
*/
template<std::size_t k>
typename enable_if<lazy_enabled<k>::value,typename Child<k>::Type&>::type
typename std::enable_if<lazy_enabled<k>::value,typename Child<k>::Type&>::type
child()
{
return node().proxiedNode().template child<k>();
......@@ -82,7 +83,7 @@ namespace Dune {
* \returns a copy of the object storing the i-th child.
*/
template<std::size_t k>
typename enable_if<lazy_enabled<k>::value,typename Child<k>::Storage>::type
typename std::enable_if<lazy_enabled<k>::value,typename Child<k>::Storage>::type
childStorage()
{
return node().proxiedNode().template childStorage<k>();
......@@ -103,14 +104,14 @@ namespace Dune {
//! Sets the i-th child to the passed-in value.
template<std::size_t k>
void setChild(typename Child<k>::type& child, typename enable_if<lazy_enabled<k>::value,void*>::type = 0)
void setChild(typename Child<k>::type& child, typename std::enable_if<lazy_enabled<k>::value,void*>::type = 0)
{
node().proxiedNode().template childStorage<k>() = stackobject_to_shared_ptr(child);
}
//! Sets the storage of the i-th child to the passed-in value.
template<std::size_t k>
void setChild(typename Child<k>::storage_type child, typename enable_if<lazy_enabled<k>::value,void*>::type = 0)
void setChild(typename Child<k>::storage_type child, typename std::enable_if<lazy_enabled<k>::value,void*>::type = 0)
{
node().proxiedNode().template childStorage<k>() = child;
}
......@@ -135,10 +136,10 @@ namespace Dune {
typedef ProxyNode<ProxiedNode> Node;
static const bool proxiedNodeIsConst = IsConst<typename remove_reference<ProxiedNode>::type>::value;
static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
template<bool enabled = !proxiedNodeIsConst>
typename enable_if<enabled,Node&>::type
typename std::enable_if<enabled,Node&>::type
node()
{
return static_cast<Node&>(*this);
......@@ -159,7 +160,7 @@ namespace Dune {
* \returns a reference to the i-th child.
*/
template<bool enabled = !proxiedNodeIsConst>
typename enable_if<enabled,typename ProxiedNode::ChildType&>::type
typename std::enable_if<enabled,typename ProxiedNode::ChildType&>::type
child (std::size_t i)
{
return node().proxiedNode().child(i);
......@@ -179,7 +180,7 @@ namespace Dune {
* \returns a copy of the object storing the i-th child.
*/
template<bool enabled = !proxiedNodeIsConst>
typename enable_if<enabled,typename ProxiedNode::ChildStorageType>::type
typename std::enable_if<enabled,typename ProxiedNode::ChildStorageType>::type
childStorage(std::size_t i)
{
return node().proxiedNode().childStorage(i);
......@@ -199,14 +200,14 @@ namespace Dune {
//! Sets the i-th child to the passed-in value.
template<bool enabled = !proxiedNodeIsConst>
void setChild (std::size_t i, typename ProxiedNode::ChildType& t, typename enable_if<enabled,void*>::type = 0)
void setChild (std::size_t i, typename ProxiedNode::ChildType& t, typename std::enable_if<enabled,void*>::type = 0)
{
node().proxiedNode().childStorage(i) = stackobject_to_shared_ptr(t);
}
//! Sets the stored value representing the i-th child to the passed-in value.
template<bool enabled = !proxiedNodeIsConst>
void setChild (std::size_t i, typename ProxiedNode::ChildStorageType st, typename enable_if<enabled,void*>::type = 0)
void setChild (std::size_t i, typename ProxiedNode::ChildStorageType st, typename std::enable_if<enabled,void*>::type = 0)
{
node().proxiedNode().childStorage(i) = st;
}
......@@ -254,7 +255,7 @@ namespace Dune {
: public ProxyNodeBase<Node,typename Node::NodeTag>
{
static const bool proxiedNodeIsConst = IsConst<typename remove_reference<Node>::type>::value;
static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
// accessor mixins need to be friends for access to proxiedNode()
friend class StaticChildAccessors<Node>;
......@@ -286,7 +287,7 @@ namespace Dune {
//! Returns the proxied node.
template<bool enabled = !proxiedNodeIsConst>
typename enable_if<enabled,Node&>::type
typename std::enable_if<enabled,Node&>::type
proxiedNode()
{
return *_node;
......@@ -300,7 +301,7 @@ namespace Dune {
//! Returns the storage of the proxied node.
template<bool enabled = !proxiedNodeIsConst>