Commit d2dc156a authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

mpl_nested_loop.hh: minor code-style changes

parent 3a03ce46
Pipeline #609 passed with stage
in 498 minutes and 32 seconds
...@@ -62,6 +62,7 @@ namespace mpl ...@@ -62,6 +62,7 @@ namespace mpl
// this is a functor wrapper that will perform an any_cast<> in each in an array // this is a functor wrapper that will perform an any_cast<> in each in an array
// of arguments according to the called types. If the cast is successful, the // of arguments according to the called types. If the cast is successful, the
// function will be called with those types, and true will be returned. // function will be called with those types, and true will be returned.
template <class Action, std::size_t N> template <class Action, std::size_t N>
struct all_any_cast struct all_any_cast
{ {
...@@ -78,17 +79,13 @@ struct all_any_cast ...@@ -78,17 +79,13 @@ struct all_any_cast
template <class T> template <class T>
T* try_any_cast(boost::any& a) const T* try_any_cast(boost::any& a) const
{ {
T * t = any_cast<T>(&a); T* t = any_cast<T>(&a);
if (t) if (t != nullptr)
{
return t; return t;
}
std::reference_wrapper<T> * tr = any_cast<std::reference_wrapper<T>>(&a); std::reference_wrapper<T>* tr = any_cast<std::reference_wrapper<T>>(&a);
if (tr) if (tr != nullptr)
{
return &(tr->get()); return &(tr->get());
}
return nullptr; return nullptr;
} }
......
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