Commit fc361da4 authored by Felix Gruber's avatar Felix Gruber

[cleanup] use enable_if from std::

parent cd4ebfae
......@@ -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<(remove_reference<N1>::type::isLeaf || 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,7 +238,7 @@ 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<!(remove_reference<N1>::type::isLeaf || 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());
......
......@@ -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))...)
{}
......
......@@ -147,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>();
......@@ -168,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>();
......@@ -189,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;
}
......@@ -213,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;
......@@ -233,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;
......
......@@ -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<is_same<
typename PowerNode::ChildType,
T>::value &&
PowerNode::CHILDREN == k,
......
......@@ -35,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);
......@@ -62,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>();
......@@ -83,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>();
......@@ -104,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;
}
......@@ -139,7 +139,7 @@ namespace Dune {
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);
......@@ -160,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);
......@@ -180,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);
......@@ -200,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;
}
......@@ -287,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;
......@@ -301,7 +301,7 @@ namespace Dune {
//! Returns the storage of the proxied node.
template<bool enabled = !proxiedNodeIsConst>
typename enable_if<enabled,shared_ptr<Node> >::type
typename std::enable_if<enabled,shared_ptr<Node> >::type
proxiedNodeStorage()
{
return _node;
......
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