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

Std config removal #1344

Closed
wants to merge 3 commits into from
Closed
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
18 changes: 0 additions & 18 deletions CMakeLists.txt
Expand Up @@ -196,16 +196,6 @@ endif()
################################################################################
# Utility configuration
################################################################################
hpx_option(HPX_UTIL_FUNCTION BOOL "Use hpx::util::function instead of boost::function or std::function (default: ON)" ON ADVANCED)
if(HPX_UTIL_FUNCTION)
hpx_add_config_define(HPX_UTIL_FUNCTION)
endif()

hpx_option(HPX_UTIL_TUPLE BOOL "Use hpx::util::tuple instead of boost::tuple or std::tuple (default: ON)" ON ADVANCED)
if(HPX_UTIL_TUPLE)
hpx_add_config_define(HPX_UTIL_TUPLE)
endif()

set(HPX_HIDDEN_VISIBILITY_DEFAULT ON)
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6.99
Expand Down Expand Up @@ -1030,14 +1020,6 @@ hpx_check_for_cxx11_std_unique_ptr(
DEFINITIONS HPX_HAVE_CXX11_STD_UNIQUE_PTR
BOOST_LOCKFREE_HAVE_CXX11_STD_UNIQUE_PTR)

if(NOT HPX_UTIL_TUPLE)
hpx_check_for_cxx11_std_tuple(DEFINITIONS HPX_HAVE_CXX11_STD_TUPLE)
endif()

if(NOT HPX_UTIL_FUNCTION)
hpx_check_for_cxx11_std_bind(DEFINITIONS HPX_HAVE_CXX11_STD_FUNCTION)
endif()

hpx_check_for_cxx11_std_initializer_list(
DEFINITIONS HPX_HAVE_CXX11_STD_INITIALIZER_LIST)

Expand Down
71 changes: 0 additions & 71 deletions cmake/tests/cxx11_std_function.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions cmake/tests/cxx11_std_tuple.cpp

This file was deleted.

4 changes: 0 additions & 4 deletions docs/manual/build_system/cmake_variables.qbk
Expand Up @@ -41,8 +41,6 @@ The options are split into these categories:
* [link build_system.cmake_variables.HPX_RUN_MAIN_EVERYWHERE HPX_RUN_MAIN_EVERYWHERE]
* [link build_system.cmake_variables.HPX_STATIC_LINKING HPX_STATIC_LINKING]
* [link build_system.cmake_variables.HPX_UNIQUE_FUTURE_ALIAS HPX_UNIQUE_FUTURE_ALIAS]
* [link build_system.cmake_variables.HPX_UTIL_FUNCTION HPX_UTIL_FUNCTION]
* [link build_system.cmake_variables.HPX_UTIL_TUPLE HPX_UTIL_TUPLE]
* [link build_system.cmake_variables.HPX_WAVE_ADDITIONAL_INCLUDE_DIRS HPX_WAVE_ADDITIONAL_INCLUDE_DIRS]
* [link build_system.cmake_variables.HPX_WITH_BOOST_ALL_DYNAMIC_LINK HPX_WITH_BOOST_ALL_DYNAMIC_LINK]
* [link build_system.cmake_variables.HPX_WITH_COMPRESSION_BZIP2 HPX_WITH_COMPRESSION_BZIP2]
Expand All @@ -69,8 +67,6 @@ The options are split into these categories:
[[[#build_system.cmake_variables.HPX_RUN_MAIN_EVERYWHERE] `HPX_RUN_MAIN_EVERYWHERE:BOOL`][Run hpx_main by default on all localities (default: OFF).]]
[[[#build_system.cmake_variables.HPX_STATIC_LINKING] `HPX_STATIC_LINKING:BOOL`][Compile HPX statically linked libraries (Default: OFF)]]
[[[#build_system.cmake_variables.HPX_UNIQUE_FUTURE_ALIAS] `HPX_UNIQUE_FUTURE_ALIAS:BOOL`][HPX will defined unique_future<R> as a template alias to future<R>. (default OFF).]]
[[[#build_system.cmake_variables.HPX_UTIL_FUNCTION] `HPX_UTIL_FUNCTION:BOOL`][Use hpx::util::function instead of boost::function or std::function (default: ON)]]
[[[#build_system.cmake_variables.HPX_UTIL_TUPLE] `HPX_UTIL_TUPLE:BOOL`][Use hpx::util::tuple instead of boost::tuple or std::tuple (default: ON)]]
[[[#build_system.cmake_variables.HPX_WAVE_ADDITIONAL_INCLUDE_DIRS] `HPX_WAVE_ADDITIONAL_INCLUDE_DIRS:STRING`][Additional (compiler specific) include directories for the wave preprocessing tool.]]
[[[#build_system.cmake_variables.HPX_WITH_BOOST_ALL_DYNAMIC_LINK] `HPX_WITH_BOOST_ALL_DYNAMIC_LINK:BOOL`][Add BOOST_ALL_DYN_LINK to compile flags]]
[[[#build_system.cmake_variables.HPX_WITH_COMPRESSION_BZIP2] `HPX_WITH_COMPRESSION_BZIP2:BOOL`][Enable bzip2 compression for parcel data (default: OFF).]]
Expand Down
2 changes: 1 addition & 1 deletion examples/heartbeat/heartbeat.cpp
Expand Up @@ -138,7 +138,7 @@ int main(int argc, char* argv[])
std::vector<std::string> cfg;
cfg.push_back("hpx.run_hpx_main!=1");

HPX_STD_FUNCTION<void()> const empty;
hpx::util::function_nonser<void()> const empty;
return hpx::init(desc_commandline, argc, argv, cfg, empty, empty, hpx::runtime_mode_connect);
}

4 changes: 2 additions & 2 deletions examples/performance_counters/sine/sine.cpp
Expand Up @@ -82,7 +82,7 @@ namespace performance_counters { namespace sine
// function has been registered with.
bool explicit_sine_counter_discoverer(
hpx::performance_counters::counter_info const& info,
HPX_STD_FUNCTION<hpx::performance_counters::discover_counter_func> const& f,
hpx::performance_counters::discover_counter_func const& f,
hpx::performance_counters::discover_counters_mode mode, hpx::error_code& ec)
{
hpx::performance_counters::counter_info i = info;
Expand Down Expand Up @@ -238,7 +238,7 @@ namespace performance_counters { namespace sine
}

///////////////////////////////////////////////////////////////////////////
bool get_startup(HPX_STD_FUNCTION<void()>& startup_func, bool& pre_startup)
bool get_startup(hpx::util::function_nonser<void()>& startup_func, bool& pre_startup)
{
// check whether the performance counters need to be enabled
if (!need_perf_counters()) {
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstart/fibonacci_futures.cpp
Expand Up @@ -39,7 +39,7 @@ boost::uint64_t add(
struct when_all_wrapper
{
typedef boost::uint64_t result_type;
typedef HPX_STD_TUPLE<
typedef hpx::util::tuple<
hpx::future<boost::uint64_t>
, hpx::future<boost::uint64_t> > data_type;

Expand All @@ -48,7 +48,7 @@ struct when_all_wrapper
) const
{
data_type v = data.get();
return HPX_STD_GET(0, v).get() + HPX_STD_GET(1, v).get();
return hpx::util::get<0>(v).get() + hpx::util::get<1>(v).get();
}
};

Expand Down
4 changes: 2 additions & 2 deletions examples/quickstart/fibonacci_futures_distributed.cpp
Expand Up @@ -36,7 +36,7 @@ hpx::id_type here;
struct when_all_wrapper
{
typedef boost::uint64_t result_type;
typedef HPX_STD_TUPLE<
typedef hpx::util::tuple<
hpx::lcos::future<boost::uint64_t>
, hpx::lcos::future<boost::uint64_t> > data_type;

Expand All @@ -45,7 +45,7 @@ struct when_all_wrapper
) const
{
data_type v = data.get();
return HPX_STD_GET(0, v).get() + HPX_STD_GET(1, v).get();
return hpx::util::get<0>(v).get() + hpx::util::get<1>(v).get();
}
};

Expand Down
8 changes: 4 additions & 4 deletions examples/quickstart/wait_composition.cpp
Expand Up @@ -12,7 +12,7 @@
struct cout_continuation
{
typedef void result_type;
typedef HPX_STD_TUPLE<
typedef hpx::util::tuple<
hpx::lcos::future<int>
, hpx::lcos::future<int>
, hpx::lcos::future<int> > data_type;
Expand All @@ -22,9 +22,9 @@ struct cout_continuation
) const
{
data_type v = data.get();
std::cout << HPX_STD_GET(0, v).get() << "\n";
std::cout << HPX_STD_GET(1, v).get() << "\n";
std::cout << HPX_STD_GET(2, v).get() << "\n";
std::cout << hpx::util::get<0>(v).get() << "\n";
std::cout << hpx::util::get<1>(v).get() << "\n";
std::cout << hpx::util::get<2>(v).get() << "\n";
}
};
///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion examples/sheneos/sheneos/interpolator.cpp
Expand Up @@ -49,7 +49,7 @@ namespace sheneos
}

///////////////////////////////////////////////////////////////////////////
bool get_shutdown(HPX_STD_FUNCTION<void()>& shutdown_func, bool& pre_shutdown)
bool get_shutdown(hpx::util::function_nonser<void()>& shutdown_func, bool& pre_shutdown)
{
shutdown_func = shutdown;
pre_shutdown = false; // run this as late as possible
Expand Down
2 changes: 1 addition & 1 deletion examples/startup_shutdown/startup_shutdown.cpp
Expand Up @@ -65,7 +65,7 @@ namespace startup_shutdown
}

///////////////////////////////////////////////////////////////////////////
bool get_startup(HPX_STD_FUNCTION<void()>& startup_func, bool& pre_startup)
bool get_startup(hpx::util::function_nonser<void()>& startup_func, bool& pre_startup)
{
startup_func = startup; // return our startup-function
pre_startup = true; // run 'startup' as pre-startup function
Expand Down
2 changes: 1 addition & 1 deletion examples/throttle/throttle_client.cpp
Expand Up @@ -94,7 +94,7 @@ int main(int argc, char* argv[])
cfg.push_back("hpx.components.load_external=0");
cfg.push_back("hpx.run_hpx_main!=1");

HPX_STD_FUNCTION<void()> const empty;
hpx::util::function_nonser<void()> const empty;
return hpx::init(cmdline, argc, argv, cfg, empty, empty, hpx::runtime_mode_connect);
}

17 changes: 10 additions & 7 deletions hpx/components/iostreams/write_functions.hpp
Expand Up @@ -8,19 +8,20 @@
#if !defined(HPX_B72D9BF0_B236_46F6_83AA_E45A70BD1FAA)
#define HPX_B72D9BF0_B236_46F6_83AA_E45A70BD1FAA

#include <hpx/util/bind.hpp>
#include <hpx/util/function.hpp>

#include <boost/ref.hpp>

#include <ostream>
#include <iterator>
#include <algorithm>
#include <deque>

#include <boost/ref.hpp>
#include <boost/bind.hpp>
#include <boost/bind/placeholders.hpp>

namespace hpx { namespace iostreams
{

typedef HPX_STD_FUNCTION<void(std::vector<char> const&)> write_function_type;
typedef util::function_nonser<void(std::vector<char> const&)> write_function_type;

///////////////////////////////////////////////////////////////////////////////
// Write function that works on STL OutputIterators
Expand All @@ -34,7 +35,8 @@ inline void iterator_write_function(std::vector<char> const& in, Iterator it)
template <typename Iterator>
inline write_function_type make_iterator_write_function(Iterator it)
{
return boost::bind(iterator_write_function<Iterator>, _1, it);
return util::bind(iterator_write_function<Iterator>,
util::placeholders::_1, it);
}

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -47,7 +49,8 @@ std_ostream_write_function(std::vector<char> const& in, std::ostream& os)
// Factory function
inline write_function_type make_std_ostream_write_function(std::ostream& os)
{
return boost::bind(std_ostream_write_function, _1, boost::ref(os));
return util::bind(std_ostream_write_function,
util::placeholders::_1, boost::ref(os));
}

}}
Expand Down
30 changes: 0 additions & 30 deletions hpx/config.hpp
Expand Up @@ -554,36 +554,6 @@
# define HPX_STD_UNIQUE_PTR ::std::unique_ptr
#endif

///////////////////////////////////////////////////////////////////////////////
// Use std::function if it's available and movable
#if defined(HPX_UTIL_FUNCTION)
# define HPX_STD_FUNCTION ::hpx::util::function_nonser
#else
#if !defined(HPX_HAVE_CXX11_STD_FUNCTION)
# define HPX_STD_FUNCTION ::boost::function
#else
# define HPX_STD_FUNCTION ::std::function
#endif
#endif

///////////////////////////////////////////////////////////////////////////////
// Use std::tuple if it's available and movable
#if defined(HPX_UTIL_TUPLE)
# define HPX_STD_TUPLE ::hpx::util::tuple
# define HPX_STD_MAKE_TUPLE ::hpx::util::make_tuple
# define HPX_STD_GET(N, c) ::hpx::util::get<N>(c)
#else
#if !defined(HPX_HAVE_CXX11_STD_TUPLE)
# define HPX_STD_TUPLE ::boost::tuple
# define HPX_STD_MAKE_TUPLE ::boost::make_tuple
# define HPX_STD_GET(N, c) ::boost::get<N>(c)
#else
# define HPX_STD_TUPLE ::std::tuple
# define HPX_STD_MAKE_TUPLE ::std::make_tuple
# define HPX_STD_GET(N, c) ::std::get<N>(c)
#endif
#endif

///////////////////////////////////////////////////////////////////////////////
// Older Boost versions do not have BOOST_NOEXCEPT defined
#if !defined(BOOST_NOEXCEPT)
Expand Down
31 changes: 0 additions & 31 deletions hpx/config/bind.hpp

This file was deleted.

21 changes: 0 additions & 21 deletions hpx/config/function.hpp

This file was deleted.