Skip to content

Commit

Permalink
Use util::optional
Browse files Browse the repository at this point in the history
  • Loading branch information
K-ballo committed Jan 14, 2018
1 parent 720afed commit abe81d6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 50 deletions.
6 changes: 0 additions & 6 deletions cmake/HPX_PerformCxxFeatureTests.cmake
Expand Up @@ -180,12 +180,6 @@ macro(hpx_perform_cxx_feature_tests)
DEFINITIONS HPX_HAVE_CXX14_DEPRECATED_ATTRIBUTE)

hpx_check_for_cxx14_return_type_deduction()

# check for experimental facilities

# check for Library Fundamentals TS v2's experimental/optional
hpx_check_for_libfun_std_experimental_optional(
DEFINITIONS HPX_HAVE_LIBFUN_STD_EXPERIMENTAL_OPTIONAL)
endif()

if(HPX_WITH_CXX1Z OR HPX_WITH_CXX17)
Expand Down
11 changes: 0 additions & 11 deletions cmake/tests/libfun_std_experimental_optional.cpp

This file was deleted.

13 changes: 2 additions & 11 deletions hpx/parallel/executors/execution.hpp
Expand Up @@ -26,6 +26,7 @@
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/detail/pack.hpp>
#include <hpx/util/invoke.hpp>
#include <hpx/util/optional.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/tuple.hpp>
#include <hpx/util/unwrap.hpp>
Expand All @@ -38,12 +39,6 @@
#include <utility>
#include <vector>

#if defined(HPX_HAVE_CXX1Y_EXPERIMENTAL_OPTIONAL)
#include <experimental/optional>
#else
#include <boost/optional.hpp>
#endif

///////////////////////////////////////////////////////////////////////////////
namespace hpx { namespace parallel { namespace execution
{
Expand Down Expand Up @@ -319,11 +314,7 @@ namespace hpx { namespace parallel { namespace execution
auto && args =
hpx::util::forward_as_tuple(std::forward<Ts>(ts)...);

#if defined(HPX_HAVE_CXX1Y_EXPERIMENTAL_OPTIONAL)
std::experimental::optional<result_type> out;
#else
boost::optional<result_type> out;
#endif
hpx::util::optional<result_type> out;
auto && wrapper =
[&]() mutable
{
Expand Down
13 changes: 2 additions & 11 deletions hpx/parallel/executors/v1/executor_traits.hpp
Expand Up @@ -21,6 +21,7 @@
#include <hpx/util/decay.hpp>
#include <hpx/util/deferred_call.hpp>
#include <hpx/util/invoke.hpp>
#include <hpx/util/optional.hpp>
#include <hpx/util/range.hpp>
#include <hpx/util/unwrap.hpp>

Expand All @@ -33,12 +34,6 @@
#include <utility>
#include <vector>

#if defined(HPX_HAVE_LIBFUN_STD_EXPERIMENTAL_OPTIONAL)
#include <experimental/optional>
#else
#include <boost/optional.hpp>
#endif

namespace hpx { namespace parallel { inline namespace v3
{
///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -128,11 +123,7 @@ namespace hpx { namespace parallel { inline namespace v3
auto && args =
hpx::util::forward_as_tuple(std::forward<Ts>(ts)...);

#if defined(HPX_HAVE_LIBFUN_STD_EXPERIMENTAL_OPTIONAL)
std::experimental::optional<result_type> out;
#else
boost::optional<result_type> out;
#endif
hpx::util::optional<result_type> out;
auto && wrapper =
[&]() mutable
{
Expand Down
13 changes: 2 additions & 11 deletions hpx/runtime/threads/run_as_hpx_thread.hpp
Expand Up @@ -11,6 +11,7 @@
#include <hpx/runtime/threads/thread_helpers.hpp>
#include <hpx/util/assert.hpp>
#include <hpx/util/invoke_fused.hpp>
#include <hpx/util/optional.hpp>
#include <hpx/util/result_of.hpp>
#include <hpx/util/tuple.hpp>

Expand All @@ -23,12 +24,6 @@
#include <type_traits>
#include <utility>

#if defined(HPX_HAVE_LIBFUN_STD_EXPERIMENTAL_OPTIONAL)
#include <experimental/optional>
#else
#include <boost/optional.hpp>
#endif

namespace hpx { namespace threads
{
///////////////////////////////////////////////////////////////////////////
Expand All @@ -48,11 +43,7 @@ namespace hpx { namespace threads
// Using the optional for storing the returned result value
// allows to support non-default-constructible and move-only
// types.
#if defined(HPX_HAVE_LIBFUN_STD_EXPERIMENTAL_OPTIONAL)
std::experimental::optional<result_type> result;
#else
boost::optional<result_type> result;
#endif
hpx::util::optional<result_type> result;

// This lambda function will be scheduled to run as an HPX
// thread
Expand Down

0 comments on commit abe81d6

Please sign in to comment.