Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove most of Boost.MPL, Boost.EnableIf and Boost.TypeTraits #2259

Merged
merged 5 commits into from Jul 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/quickstart/data_actions.cpp
Expand Up @@ -6,6 +6,8 @@
#include <hpx/hpx_main.hpp>
#include <hpx/hpx.hpp>

#include <type_traits>

///////////////////////////////////////////////////////////////////////////////
/// placeholder type allowing to integrate the data action templates below
/// with the existing component based action template infrastructure
Expand Down Expand Up @@ -39,7 +41,7 @@ struct data_get_action
data_get_action<T, Data, Derived>, Derived
>::type>
{
typedef boost::mpl::false_ direct_execution;
typedef std::false_type direct_execution;

typedef typename boost::remove_pointer<T>::type data_type;

Expand Down Expand Up @@ -68,7 +70,7 @@ struct data_set_action
{
typedef typename boost::remove_pointer<T>::type data_type;

typedef boost::mpl::false_ direct_execution;
typedef std::false_type direct_execution;

// Return the referenced data
static void invoke(
Expand Down
14 changes: 6 additions & 8 deletions hpx/apply.hpp
Expand Up @@ -19,8 +19,6 @@
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/thread_description.hpp>

#include <boost/utility/enable_if.hpp>

#include <type_traits>

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -36,7 +34,7 @@ namespace hpx { namespace detail
{
template <typename F, typename ...Ts>
HPX_FORCEINLINE static
typename boost::enable_if_c<
typename std::enable_if<
traits::detail::is_deferred_callable<F(Ts&&...)>::value,
bool
>::type
Expand All @@ -53,13 +51,13 @@ namespace hpx { namespace detail
// threads::executor
template <typename Executor>
struct apply_dispatch<Executor,
typename boost::enable_if_c<
typename std::enable_if<
traits::is_threads_executor<Executor>::value
>::type>
{
template <typename F, typename ...Ts>
HPX_FORCEINLINE static
typename boost::enable_if_c<
typename std::enable_if<
traits::detail::is_deferred_callable<F(Ts&&...)>::value,
bool
>::type
Expand All @@ -75,13 +73,13 @@ namespace hpx { namespace detail
// parallel::executor
template <typename Executor>
struct apply_dispatch<Executor,
typename boost::enable_if_c<
typename std::enable_if<
traits::is_executor<Executor>::value
>::type>
{
template <typename F, typename ...Ts>
HPX_FORCEINLINE static
typename boost::enable_if_c<
typename std::enable_if<
traits::detail::is_deferred_callable<F(Ts&&...)>::value,
bool
>::type
Expand All @@ -96,7 +94,7 @@ namespace hpx { namespace detail
// bound action
template <typename Bound>
struct apply_dispatch<Bound,
typename boost::enable_if_c<
typename std::enable_if<
traits::is_bound_action<Bound>::value
>::type>
{
Expand Down
42 changes: 20 additions & 22 deletions hpx/async.hpp
Expand Up @@ -18,9 +18,7 @@
#include <hpx/util/bind_action.hpp>
#include <hpx/util/deferred_call.hpp>

#include <boost/type_traits/is_void.hpp>
#include <boost/utility/enable_if.hpp>

#include <functional>
#include <type_traits>

namespace hpx { namespace detail
Expand All @@ -43,16 +41,16 @@ namespace hpx { namespace detail

template <typename F>
HPX_FORCEINLINE
typename boost::lazy_enable_if<
boost::is_reference<typename util::detail::deferred_result_of<F&&()>::type>
typename std::enable_if<
std::is_reference<typename util::detail::deferred_result_of<F&&()>::type>::value
, detail::create_future<F&&()>
>::type
call_sync(F&& f, boost::mpl::false_)
>::type::type
call_sync(F&& f, std::false_type)
{
typedef typename util::detail::deferred_result_of<F&&()>::type result_type;
try
{
return lcos::make_ready_future(boost::ref(f()));
return lcos::make_ready_future(std::ref(f()));
} catch (...) {
return lcos::make_exceptional_future<result_type>
(boost::current_exception());
Expand All @@ -61,11 +59,11 @@ namespace hpx { namespace detail

template <typename F>
HPX_FORCEINLINE
typename boost::lazy_disable_if<
boost::is_reference<typename util::detail::deferred_result_of<F&&()>::type>
typename std::enable_if<
!std::is_reference<typename util::detail::deferred_result_of<F&&()>::type>::value
, detail::create_future<F()>
>::type
call_sync(F&& f, boost::mpl::false_) //-V659
>::type::type
call_sync(F&& f, std::false_type) //-V659
{
typedef typename util::detail::deferred_result_of<F()>::type result_type;
try
Expand All @@ -79,7 +77,7 @@ namespace hpx { namespace detail

template <typename F>
HPX_FORCEINLINE typename detail::create_future<F()>::type
call_sync(F&& f, boost::mpl::true_)
call_sync(F&& f, std::true_type)
{
try
{
Expand All @@ -93,13 +91,13 @@ namespace hpx { namespace detail
///////////////////////////////////////////////////////////////////////////
template <typename Action>
struct async_launch_policy_dispatch<Action,
typename boost::enable_if_c<
typename std::enable_if<
!traits::is_action<Action>::value
>::type>
{
template <typename F, typename ...Ts>
HPX_FORCEINLINE static
typename boost::enable_if_c<
typename std::enable_if<
traits::detail::is_deferred_callable<F&&(Ts&&...)>::value,
hpx::future<
typename util::detail::deferred_result_of<F&&(Ts&&...)>::type
Expand All @@ -114,7 +112,7 @@ namespace hpx { namespace detail
if (launch_policy == launch::sync) {
return detail::call_sync(
util::deferred_call(std::forward<F>(f), std::forward<Ts>(ts)...),
typename boost::is_void<result_type>::type());
typename std::is_void<result_type>::type());
}
lcos::local::futures_factory<result_type()> p(
util::deferred_call(std::forward<F>(f), std::forward<Ts>(ts)...));
Expand All @@ -138,7 +136,7 @@ namespace hpx { namespace detail
{
template <typename F, typename ...Ts>
HPX_FORCEINLINE static
typename boost::enable_if_c<
typename std::enable_if<
traits::detail::is_deferred_callable<F&&(Ts&&...)>::value,
hpx::future<
typename util::detail::deferred_result_of<F&&(Ts&&...)>::type
Expand All @@ -154,13 +152,13 @@ namespace hpx { namespace detail
// threads::executor
template <typename Executor>
struct async_dispatch<Executor,
typename boost::enable_if_c<
typename std::enable_if<
traits::is_threads_executor<Executor>::value
>::type>
{
template <typename F, typename ...Ts>
HPX_FORCEINLINE static
typename boost::enable_if_c<
typename std::enable_if<
traits::detail::is_deferred_callable<F&&(Ts&&...)>::value,
hpx::future<
typename util::detail::deferred_result_of<F&&(Ts&&...)>::type
Expand All @@ -182,13 +180,13 @@ namespace hpx { namespace detail
// parallel::executor
template <typename Executor>
struct async_dispatch<Executor,
typename boost::enable_if_c<
typename std::enable_if<
traits::is_executor<Executor>::value
>::type>
{
template <typename F, typename ...Ts>
HPX_FORCEINLINE static
typename boost::enable_if_c<
typename std::enable_if<
traits::detail::is_deferred_callable<F&&(Ts&&...)>::value,
hpx::future<
typename util::detail::deferred_result_of<F&&(Ts&&...)>::type
Expand All @@ -204,7 +202,7 @@ namespace hpx { namespace detail
// bound action
template <typename Bound>
struct async_dispatch<Bound,
typename boost::enable_if_c<
typename std::enable_if<
traits::is_bound_action<Bound>::value
>::type>
{
Expand Down
6 changes: 3 additions & 3 deletions hpx/components/security/capability.hpp
Expand Up @@ -13,10 +13,10 @@
#include <hpx/traits/is_bitwise_serializable.hpp>

#include <boost/array.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/cstdint.hpp>

#include <climits>
#include <type_traits>

namespace hpx { namespace components { namespace security
{
Expand Down Expand Up @@ -181,7 +181,7 @@ namespace hpx { namespace traits
template <>
struct is_bitwise_serializable<
hpx::components::security::capability>
: boost::mpl::true_
: std::true_type
{};
}}

Expand Down
12 changes: 1 addition & 11 deletions hpx/components/security/certificate.hpp
Expand Up @@ -18,9 +18,6 @@
#include "certificate_signing_request.hpp"
#include "public_key.hpp"

#include <boost/io/ios_state.hpp>
#include <boost/mpl/bool.hpp>

namespace hpx { namespace components { namespace security
{
#if defined(HPX_MSVC)
Expand Down Expand Up @@ -124,14 +121,7 @@ namespace hpx { namespace components { namespace security
#endif
}}}

namespace hpx { namespace traits
{
template <>
struct is_bitwise_serializable<
hpx::components::security::certificate>
: boost::mpl::true_
{};
}}
HPX_IS_BITWISE_SERIALIZABLE(hpx::components::security::certificate)

#endif

Expand Down
12 changes: 2 additions & 10 deletions hpx/components/security/certificate_signing_request.hpp
Expand Up @@ -17,8 +17,6 @@
#include <hpx/components/security/capability.hpp>
#include <hpx/components/security/public_key.hpp>

#include <boost/mpl/bool.hpp>

namespace hpx { namespace components { namespace security
{
#if defined(HPX_MSVC)
Expand Down Expand Up @@ -104,14 +102,8 @@ namespace hpx { namespace components { namespace security
#endif
}}}

namespace hpx { namespace traits
{
template <>
struct is_bitwise_serializable<
hpx::components::security::certificate_signing_request>
: boost::mpl::true_
{};
}}
HPX_IS_BITWISE_SERIALIZABLE(
hpx::components::security::certificate_signing_request)

#endif

Expand Down
10 changes: 1 addition & 9 deletions hpx/components/security/public_key.hpp
Expand Up @@ -16,7 +16,6 @@

#include <boost/array.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/mpl/bool.hpp>

#include <sodium.h>

Expand Down Expand Up @@ -85,14 +84,7 @@ namespace hpx { namespace components { namespace security
#endif
}}}

namespace hpx { namespace traits
{
template <>
struct is_bitwise_serializable<
hpx::components::security::public_key>
: boost::mpl::true_
{};
}}
HPX_IS_BITWISE_SERIALIZABLE(hpx::components::security::public_key)

#endif

Expand Down
10 changes: 1 addition & 9 deletions hpx/components/security/signature.hpp
Expand Up @@ -16,7 +16,6 @@

#include <boost/array.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/mpl/bool.hpp>

#include <sodium.h>

Expand Down Expand Up @@ -72,14 +71,7 @@ namespace hpx { namespace components { namespace security
#endif
}}}

namespace hpx { namespace traits
{
template <>
struct is_bitwise_serializable<
hpx::components::security::signature>
: boost::mpl::true_
{};
}}
HPX_IS_BITWISE_SERIALIZABLE(hpx::components::security::signature)

#endif

Expand Down
4 changes: 2 additions & 2 deletions hpx/components/security/signed_type.hpp
Expand Up @@ -15,7 +15,7 @@

#include <hpx/components/security/signature.hpp>

#include <boost/mpl/bool.hpp>
#include <type_traits>

namespace hpx { namespace components { namespace security
{
Expand Down Expand Up @@ -105,7 +105,7 @@ namespace hpx { namespace traits
template <typename T>
struct is_bitwise_serializable<
hpx::components::security::signed_type<T> >
: boost::mpl::true_
: std::true_type
{};
}}

Expand Down
1 change: 1 addition & 0 deletions hpx/compute/cuda/detail/launch.hpp
Expand Up @@ -23,6 +23,7 @@
#include <cstring>
#endif
#include <string>
#include <type_traits>
#include <utility>

namespace hpx { namespace compute { namespace cuda { namespace detail
Expand Down
2 changes: 2 additions & 0 deletions hpx/compute/cuda/transfer.hpp
Expand Up @@ -16,6 +16,8 @@
#include <hpx/compute/cuda/allocator.hpp>
#include <hpx/compute/detail/iterator.hpp>

#include <type_traits>

namespace hpx { namespace traits
{
struct trivially_cuda_copyable_pointer_tag : general_pointer_tag{};
Expand Down
1 change: 1 addition & 0 deletions hpx/compute/vector.hpp
Expand Up @@ -18,6 +18,7 @@

#include <initializer_list>
#include <memory>
#include <type_traits>
#include <utility>

namespace hpx { namespace compute
Expand Down