From 3299d77703e8152896f54c904a6d7e741ecf232b Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Fri, 5 Jul 2019 08:34:39 +0200 Subject: [PATCH 1/2] Making hpx::util::tuple and std::tuple convertible Fixes #1403 by allowing the use of hpx::util::get with std::tuple and std::get with hpx::util::tuple::get. Same goes for the utilities tuple_size and tuple_element. An additional conversion operator from hpx::util::tuple to std::tuple has been added to make the two types interchangable. Flyby: Making the datastructures unit test only depend on itself and hpx_testing: Adding hpx/traits/is_tuple_like.hpp --- libs/datastructures/CMakeLists.txt | 1 + .../include/hpx/datastructures/tuple.hpp | 79 +++++++++++++++++++ .../include/hpx}/traits/is_tuple_like.hpp | 0 libs/datastructures/tests/unit/CMakeLists.txt | 3 +- libs/datastructures/tests/unit/any.cpp | 16 +--- .../tests/unit/small_big_object.hpp | 8 +- libs/datastructures/tests/unit/tuple.cpp | 42 +++++++++- 7 files changed, 126 insertions(+), 23 deletions(-) rename {hpx => libs/datastructures/include/hpx}/traits/is_tuple_like.hpp (100%) diff --git a/libs/datastructures/CMakeLists.txt b/libs/datastructures/CMakeLists.txt index f68621e81d10..e61a20747495 100644 --- a/libs/datastructures/CMakeLists.txt +++ b/libs/datastructures/CMakeLists.txt @@ -12,6 +12,7 @@ set(datastructures_headers hpx/datastructures/optional.hpp hpx/datastructures/detail/pack.hpp hpx/traits/supports_streaming_with_any.hpp + hpx/traits/is_tuple_like.hpp ) set(datastructures_compat_headers diff --git a/libs/datastructures/include/hpx/datastructures/tuple.hpp b/libs/datastructures/include/hpx/datastructures/tuple.hpp index d2e5b0d45013..fddaf17ef94d 100644 --- a/libs/datastructures/include/hpx/datastructures/tuple.hpp +++ b/libs/datastructures/include/hpx/datastructures/tuple.hpp @@ -18,6 +18,7 @@ #include #include #include // for size_t +#include #include #include @@ -26,6 +27,11 @@ #pragma warning(disable : 4520) // multiple default constructors specified #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + namespace hpx { namespace util { template class tuple; @@ -55,7 +61,26 @@ namespace hpx { namespace util { HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE typename tuple_element::type const&& get(Tuple const&& t) noexcept; +}} +// Adapt hpx::util::tuple to be useable with std::tuple +namespace std +{ + template + struct tuple_size> + : public hpx::util::tuple_size> + {}; + + template + struct tuple_element> + : public hpx::util::tuple_element> + {}; + + using hpx::util::get; +} + +namespace hpx { namespace util +{ namespace detail { /////////////////////////////////////////////////////////////////////// template @@ -307,6 +332,18 @@ namespace hpx { namespace util { typename detail::at_index::type> const&>(*this) .value(); } + + HPX_HOST_DEVICE + operator std::tuple() const & + { + return std::make_tuple(get()...); + } + + HPX_HOST_DEVICE + operator std::tuple() && + { + return std::make_tuple(std::move(get())...); + } }; /////////////////////////////////////////////////////////////////////// @@ -362,6 +399,11 @@ namespace hpx { namespace util { // Calls swap for each element in *this and its corresponding element // in rhs. HPX_HOST_DEVICE void swap(tuple& /*other*/) noexcept {} + + operator std::tuple<>() const + { + return std::tuple<>(); + } }; template @@ -503,6 +545,16 @@ namespace hpx { namespace util { { _impl.swap(other._impl); } + + operator std::tuple() const& + { + return _impl; + } + + operator std::tuple() && + { + return _impl; + } }; // 20.4.2.5, tuple helper classes @@ -553,6 +605,11 @@ namespace hpx { namespace util { { }; + template + struct tuple_size> + : std::tuple_size> + {}; + // template // class tuple_element template @@ -668,6 +725,24 @@ namespace hpx { namespace util { } }; + template + struct tuple_element> + { + using type = typename std::tuple_element>::type; + + static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& + get(std::tuple& tuple) noexcept + { + return std::get(tuple); + } + + static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type const& + get(std::tuple const& tuple) noexcept + { + return std::get(tuple); + } + }; + // 20.4.2.6, element access // template @@ -1018,4 +1093,8 @@ namespace hpx { namespace util { #pragma warning(pop) #endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #endif diff --git a/hpx/traits/is_tuple_like.hpp b/libs/datastructures/include/hpx/traits/is_tuple_like.hpp similarity index 100% rename from hpx/traits/is_tuple_like.hpp rename to libs/datastructures/include/hpx/traits/is_tuple_like.hpp diff --git a/libs/datastructures/tests/unit/CMakeLists.txt b/libs/datastructures/tests/unit/CMakeLists.txt index 6388cb13eb70..cedc62df1a31 100644 --- a/libs/datastructures/tests/unit/CMakeLists.txt +++ b/libs/datastructures/tests/unit/CMakeLists.txt @@ -22,7 +22,8 @@ foreach(test ${tests}) # add example executable add_hpx_executable(${test}_test SOURCES ${sources} - ${${test}_FLAGS} + NOLIBS + DEPENDENCIES hpx_datastructures hpx_testing EXCLUDE_FROM_ALL FOLDER ${folder_name}) diff --git a/libs/datastructures/tests/unit/any.cpp b/libs/datastructures/tests/unit/any.cpp index b578f1cc5c4b..34a3625de9c5 100644 --- a/libs/datastructures/tests/unit/any.cpp +++ b/libs/datastructures/tests/unit/any.cpp @@ -7,11 +7,8 @@ //////////////////////////////////////////////////////////////////////////////// #include -#include #include -#include - #include #include #include @@ -24,11 +21,8 @@ using hpx::util::any_cast; using hpx::util::any_nonser; using hpx::util::streamable_any_nonser; -using hpx::finalize; -using hpx::init; - /////////////////////////////////////////////////////////////////////////////// -int hpx_main() +int main() { { streamable_any_nonser any1(big_object(30, 40)); @@ -134,13 +128,5 @@ int hpx_main() } } - finalize(); return hpx::util::report_errors(); } - -/////////////////////////////////////////////////////////////////////////////// -int main(int argc, char* argv[]) -{ - // Initialize and run HPX - return init(argc, argv); -} diff --git a/libs/datastructures/tests/unit/small_big_object.hpp b/libs/datastructures/tests/unit/small_big_object.hpp index 93555b4ad1aa..53a86ff7d660 100644 --- a/libs/datastructures/tests/unit/small_big_object.hpp +++ b/libs/datastructures/tests/unit/small_big_object.hpp @@ -9,8 +9,6 @@ #ifndef HPX_SMALL_BIG_OBJECT_HPP #define HPX_SMALL_BIG_OBJECT_HPP -#include - #include #include @@ -22,8 +20,7 @@ struct small_object private: std::uint64_t x_; - friend class hpx::serialization::access; - + public: template void serialize(Archive& ar, unsigned const) { @@ -130,8 +127,7 @@ struct big_object std::uint64_t x_; std::uint64_t y_; - friend class hpx::serialization::access; - + public: template void serialize(Archive& ar, unsigned const) { diff --git a/libs/datastructures/tests/unit/tuple.cpp b/libs/datastructures/tests/unit/tuple.cpp index bed34963a507..e3205c3cc88f 100644 --- a/libs/datastructures/tests/unit/tuple.cpp +++ b/libs/datastructures/tests/unit/tuple.cpp @@ -21,7 +21,6 @@ // clang-format on #include -#include #include #include @@ -537,6 +536,46 @@ void tuple_swap_test() HPX_TEST(j == 1); } +void tuple_std_test() +{ + hpx::util::tuple t1(1, 2.0f, 3.0); + std::tuple t2 = t1; + hpx::util::tuple t3 = t2; + HPX_TEST(std::get<0>(t1) == 1); + HPX_TEST(std::get<0>(t2) == 1); + HPX_TEST(std::get<0>(t3) == 1); + + HPX_TEST(hpx::util::get<0>(t1) == 1); + HPX_TEST(hpx::util::get<0>(t2) == 1); + HPX_TEST(hpx::util::get<0>(t3) == 1); + + HPX_TEST(std::get<1>(t1) == 2.0f); + HPX_TEST(std::get<1>(t2) == 2.0f); + HPX_TEST(std::get<1>(t3) == 2.0f); + + HPX_TEST(hpx::util::get<1>(t1) == 2.0f); + HPX_TEST(hpx::util::get<1>(t2) == 2.0f); + HPX_TEST(hpx::util::get<1>(t3) == 2.0f); + + HPX_TEST(std::get<2>(t1) == 3.0); + HPX_TEST(std::get<2>(t2) == 3.0); + HPX_TEST(std::get<2>(t3) == 3.0); + + HPX_TEST(hpx::util::get<2>(t1) == 3.0); + HPX_TEST(hpx::util::get<2>(t2) == 3.0); + HPX_TEST(hpx::util::get<2>(t3) == 3.0); +} + +void tuple_structured_binding_test() +{ +#if defined(HPX_HAVE_CXX17_STRUCTURED_BINDINGS) + auto [a1, a2] = hpx::util::make_tuple(1, '2'); + + HPX_TEST_EQ(a1, 1); + HPX_TEST_EQ(a2, '2'); +#endif +} + /////////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { @@ -553,6 +592,7 @@ int main(int argc, char* argv[]) const_tuple_test(); tuple_length_test(); tuple_swap_test(); + tuple_structured_binding_test(); } return hpx::util::report_errors(); From 4f035dc2c2c6cc66bdb261c72da762f129eb37c8 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 24 Sep 2019 14:11:56 -0500 Subject: [PATCH 2/2] Hiding implementations of std::get<> for hpx::util::future behind an ADL barrier - adding option to disable the integration of hpx::tuple with std::tuple - flyby: fixing default value for HPX_FILESYSTEM_WITH_BOOST_FILESYSTEM_COMPATIBILITY --- libs/datastructures/CMakeLists.txt | 15 ++ .../include/hpx/datastructures/tuple.hpp | 249 +++++++++++------- .../include/hpx/traits/is_tuple_like.hpp | 30 +-- libs/datastructures/tests/unit/CMakeLists.txt | 3 +- .../tests/unit/small_big_object.hpp | 4 +- libs/datastructures/tests/unit/tuple.cpp | 2 + libs/filesystem/CMakeLists.txt | 2 +- 7 files changed, 191 insertions(+), 114 deletions(-) diff --git a/libs/datastructures/CMakeLists.txt b/libs/datastructures/CMakeLists.txt index e61a20747495..b95ed852e91d 100644 --- a/libs/datastructures/CMakeLists.txt +++ b/libs/datastructures/CMakeLists.txt @@ -6,6 +6,17 @@ cmake_minimum_required(VERSION 3.3.2 FATAL_ERROR) +# Compatibility with using Boost.FileSystem, introduced in V1.4.0 +hpx_option(HPX_DATASTRUCTURES_WITH_ADAPT_STD_TUPLE + BOOL "Enable compatibility of hpx::util::tuple with std::tuple. (default: ON)" + ON ADVANCED CATEGORY "Modules") + +if(HPX_DATASTRUCTURES_WITH_ADAPT_STD_TUPLE) + hpx_add_config_define_namespace( + DEFINE HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE + NAMESPACE DATASTRUCTURES) +endif() + set(datastructures_headers hpx/datastructures/any.hpp hpx/datastructures/tuple.hpp @@ -42,3 +53,7 @@ add_hpx_module(datastructures hpx_type_support CMAKE_SUBDIRS examples tests ) + +if(HPX_DATASTRUCTURES_WITH_ADAPT_STD_TUPLE) + hpx_info(" Adapted hpx::util::tuple to be usable with std::tuple") +endif() diff --git a/libs/datastructures/include/hpx/datastructures/tuple.hpp b/libs/datastructures/include/hpx/datastructures/tuple.hpp index fddaf17ef94d..a32dc44687aa 100644 --- a/libs/datastructures/include/hpx/datastructures/tuple.hpp +++ b/libs/datastructures/include/hpx/datastructures/tuple.hpp @@ -10,6 +10,7 @@ #define HPX_UTIL_TUPLE_HPP #include +#include #include #include @@ -33,6 +34,7 @@ #endif namespace hpx { namespace util { + template class tuple; @@ -42,46 +44,59 @@ namespace hpx { namespace util { template struct tuple_element; // undefined - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type& - get(Tuple& t) noexcept; - - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type const& - get(Tuple const& t) noexcept; - - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type&& - get(Tuple&& t) noexcept; - - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type const&& - get(Tuple const&& t) noexcept; -}} + // Hide implementations of get<> inside an internal namespace to be able to + // import those into the namespace std below without pulling in all of + // hpx::util. + namespace adl_barrier { + + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type& + get(Tuple& t) noexcept; + + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type const& + get(Tuple const& t) noexcept; + + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type&& + get(Tuple&& t) noexcept; + + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type const&& + get(Tuple const&& t) noexcept; + } // namespace adl_barrier + + using hpx::util::adl_barrier::get; +}} // namespace hpx::util +#if defined(HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE) // Adapt hpx::util::tuple to be useable with std::tuple -namespace std -{ +namespace std { + template struct tuple_size> : public hpx::util::tuple_size> - {}; + { + }; template struct tuple_element> : public hpx::util::tuple_element> - {}; + { + }; - using hpx::util::get; -} + using hpx::util::adl_barrier::get; +} // namespace std +#endif + +namespace hpx { namespace util { -namespace hpx { namespace util -{ namespace detail { + /////////////////////////////////////////////////////////////////////// template struct tuple_member //-V690 @@ -188,8 +203,8 @@ namespace hpx { namespace util struct are_tuples_compatible_impl, tuple, UTuple> { - typedef char (&no_type)[1]; - typedef char (&yes_type)[2]; + using no_type = char (&)[1]; + using yes_type = char (&)[2]; static no_type call(...); static yes_type call(Ts...); @@ -198,7 +213,7 @@ namespace hpx { namespace util sizeof(call(util::get(std::declval())...) //-V510 ) == sizeof(yes_type); - typedef std::integral_constant type; + using type = std::integral_constant; }; template @@ -333,8 +348,9 @@ namespace hpx { namespace util .value(); } +#if defined(HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE) HPX_HOST_DEVICE - operator std::tuple() const & + operator std::tuple() const& { return std::make_tuple(get()...); } @@ -344,6 +360,19 @@ namespace hpx { namespace util { return std::make_tuple(std::move(get())...); } + + HPX_HOST_DEVICE + operator std::tuple() & + { + return std::make_tuple(get()...); + } + + HPX_HOST_DEVICE + operator std::tuple() const&& + { + return std::make_tuple(std::move(get())...); + } +#endif }; /////////////////////////////////////////////////////////////////////// @@ -370,12 +399,12 @@ namespace hpx { namespace util // tuple(const tuple& u) = default; // Initializes each element of *this with the corresponding element // of u. - HPX_CONSTEXPR HPX_HOST_DEVICE tuple(tuple const& /*other*/) {} + HPX_CONSTEXPR HPX_HOST_DEVICE tuple(tuple const& /*other*/) = default; // tuple(tuple&& u) = default; // For all i, initializes the ith element of *this with // std::forward(get(u)). - HPX_CONSTEXPR HPX_HOST_DEVICE tuple(tuple&& /*other*/) {} + HPX_CONSTEXPR HPX_HOST_DEVICE tuple(tuple&& /*other*/) = default; // 20.4.2.2, tuple assignment @@ -400,10 +429,12 @@ namespace hpx { namespace util // in rhs. HPX_HOST_DEVICE void swap(tuple& /*other*/) noexcept {} +#if defined(HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE) operator std::tuple<>() const { return std::tuple<>(); } +#endif }; template @@ -546,15 +577,27 @@ namespace hpx { namespace util _impl.swap(other._impl); } +#if defined(HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE) operator std::tuple() const& { return _impl; } + operator std::tuple() & + { + return _impl; + } + operator std::tuple() && { return _impl; } + + operator std::tuple() const&& + { + return _impl; + } +#endif }; // 20.4.2.5, tuple helper classes @@ -605,10 +648,12 @@ namespace hpx { namespace util { }; - template - struct tuple_size> - : std::tuple_size> - {}; +#if defined(HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE) + template + struct tuple_size> : std::tuple_size> + { + }; +#endif // template // class tuple_element @@ -638,7 +683,7 @@ namespace hpx { namespace util template struct tuple_element> { - typedef typename detail::at_index::type type; + using type = typename detail::at_index::type; static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& get( tuple& tuple) noexcept @@ -656,7 +701,7 @@ namespace hpx { namespace util template struct tuple_element<0, std::pair> { - typedef T0 type; + using type = T0; static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& get( std::pair& tuple) noexcept @@ -674,7 +719,7 @@ namespace hpx { namespace util template struct tuple_element<1, std::pair> { - typedef T1 type; + using type = T1; static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& get( std::pair& tuple) noexcept @@ -692,7 +737,7 @@ namespace hpx { namespace util template struct tuple_element> { - typedef Type type; + using type = Type; static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& get( boost::array& tuple) noexcept @@ -710,7 +755,7 @@ namespace hpx { namespace util template struct tuple_element> { - typedef Type type; + using type = Type; static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& get( std::array& tuple) noexcept @@ -725,71 +770,87 @@ namespace hpx { namespace util } }; - template +#if defined(HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE) + template struct tuple_element> { using type = typename std::tuple_element>::type; - static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& - get(std::tuple& tuple) noexcept + static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type& get( + std::tuple& tuple) noexcept { return std::get(tuple); } - static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type const& - get(std::tuple const& tuple) noexcept + static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type const& get( + std::tuple const& tuple) noexcept { return std::get(tuple); } + + static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type&& get( + std::tuple&& tuple) noexcept + { + return std::get(std::move(tuple)); + } + + static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE type const&& get( + std::tuple const&& tuple) noexcept + { + return std::get(std::move(tuple)); + } }; +#endif // 20.4.2.6, element access + namespace adl_barrier { + + // template + // constexpr typename tuple_element >::type& + // get(tuple& t) noexcept; + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type& + get(Tuple& t) noexcept + { + return tuple_element::get(t); + } - // template - // constexpr typename tuple_element >::type& - // get(tuple& t) noexcept; - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type& - get(Tuple& t) noexcept - { - return tuple_element::get(t); - } - - // template - // constexpr typename tuple_element >::type const& - // get(const tuple& t) noexcept; - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type const& - get(Tuple const& t) noexcept - { - return tuple_element::get(t); - } + // template + // constexpr typename tuple_element >::type const& + // get(const tuple& t) noexcept; + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type const& + get(Tuple const& t) noexcept + { + return tuple_element::get(t); + } - // template - // constexpr typename tuple_element >::type&& - // get(tuple&& t) noexcept; - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type&& - get(Tuple&& t) noexcept - { - return std::forward::type>( - util::get(t)); - } + // template + // constexpr typename tuple_element >::type&& + // get(tuple&& t) noexcept; + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type&& + get(Tuple&& t) noexcept + { + return std::forward::type>( + util::get(t)); + } - // template - // constexpr typename tuple_element >::type const&& - // get(const tuple&& t) noexcept; - template - HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE - typename tuple_element::type const&& - get(Tuple const&& t) noexcept - { - return std::forward::type const>( - util::get(t)); - } + // template + // constexpr typename tuple_element >::type const&& + // get(const tuple&& t) noexcept; + template + HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE + typename tuple_element::type const&& + get(Tuple const&& t) noexcept + { + return std::forward::type const>( + util::get(t)); + } + } // namespace adl_barrier // 20.4.2.4, tuple creation functions detail::ignore_type const ignore = {}; @@ -829,6 +890,7 @@ namespace hpx { namespace util //template //constexpr tuple tuple_cat(Tuples&&...); namespace detail { + /// Deduces to the overall size of all given tuples template struct tuple_cat_size_impl; @@ -875,9 +937,8 @@ namespace hpx { namespace util : tuple_cat_element::value, detail::pack> { - typedef tuple_cat_element::value, - detail::pack> - base_type; + using base_type = tuple_cat_element::value, + detail::pack>; template static HPX_CONSTEXPR HPX_HOST_DEVICE HPX_FORCEINLINE auto get( diff --git a/libs/datastructures/include/hpx/traits/is_tuple_like.hpp b/libs/datastructures/include/hpx/traits/is_tuple_like.hpp index 77a12cdb8236..75a8af15ee9a 100644 --- a/libs/datastructures/include/hpx/traits/is_tuple_like.hpp +++ b/libs/datastructures/include/hpx/traits/is_tuple_like.hpp @@ -9,31 +9,31 @@ #include -#include #include +#include -namespace hpx { namespace traits -{ - namespace detail - { +namespace hpx { namespace traits { + namespace detail { template - struct is_tuple_like_impl - : std::false_type - {}; + struct is_tuple_like_impl : std::false_type + { + }; template - struct is_tuple_like_impl::value)>::type - > : std::true_type - {}; - } + struct is_tuple_like_impl::value)>::type> : std::true_type + { + }; + } // namespace detail /// Deduces to a true type if the given parameter T /// has a specific tuple like size. template struct is_tuple_like : detail::is_tuple_like_impl::type> - {}; -}} + { + }; +}} // namespace hpx::traits #endif /*HPX_TRAITS_IS_TUPLE_LIKE_HPP*/ diff --git a/libs/datastructures/tests/unit/CMakeLists.txt b/libs/datastructures/tests/unit/CMakeLists.txt index cedc62df1a31..6388cb13eb70 100644 --- a/libs/datastructures/tests/unit/CMakeLists.txt +++ b/libs/datastructures/tests/unit/CMakeLists.txt @@ -22,8 +22,7 @@ foreach(test ${tests}) # add example executable add_hpx_executable(${test}_test SOURCES ${sources} - NOLIBS - DEPENDENCIES hpx_datastructures hpx_testing + ${${test}_FLAGS} EXCLUDE_FROM_ALL FOLDER ${folder_name}) diff --git a/libs/datastructures/tests/unit/small_big_object.hpp b/libs/datastructures/tests/unit/small_big_object.hpp index 53a86ff7d660..13c425b46a30 100644 --- a/libs/datastructures/tests/unit/small_big_object.hpp +++ b/libs/datastructures/tests/unit/small_big_object.hpp @@ -20,7 +20,7 @@ struct small_object private: std::uint64_t x_; - public: +public: template void serialize(Archive& ar, unsigned const) { @@ -127,7 +127,7 @@ struct big_object std::uint64_t x_; std::uint64_t y_; - public: +public: template void serialize(Archive& ar, unsigned const) { diff --git a/libs/datastructures/tests/unit/tuple.cpp b/libs/datastructures/tests/unit/tuple.cpp index e3205c3cc88f..9875bcfb53ba 100644 --- a/libs/datastructures/tests/unit/tuple.cpp +++ b/libs/datastructures/tests/unit/tuple.cpp @@ -538,6 +538,7 @@ void tuple_swap_test() void tuple_std_test() { +#if defined(HPX_DATASTRUCTURES_HAVE_ADAPT_STD_TUPLE) hpx::util::tuple t1(1, 2.0f, 3.0); std::tuple t2 = t1; hpx::util::tuple t3 = t2; @@ -564,6 +565,7 @@ void tuple_std_test() HPX_TEST(hpx::util::get<2>(t1) == 3.0); HPX_TEST(hpx::util::get<2>(t2) == 3.0); HPX_TEST(hpx::util::get<2>(t3) == 3.0); +#endif } void tuple_structured_binding_test() diff --git a/libs/filesystem/CMakeLists.txt b/libs/filesystem/CMakeLists.txt index bafc00f330e2..60ed0b5cb732 100644 --- a/libs/filesystem/CMakeLists.txt +++ b/libs/filesystem/CMakeLists.txt @@ -14,7 +14,7 @@ endif() # Compatibility with using Boost.FileSystem, introduced in V1.4.0 hpx_option(HPX_FILESYSTEM_WITH_BOOST_FILESYSTEM_COMPATIBILITY BOOL "Enable Boost.FileSystem compatibility. (default: ${__filesystem_compatibility_default})" - ON ADVANCED CATEGORY "Modules") + ${__filesystem_compatibility_default} ADVANCED CATEGORY "Modules") set(__boost_filesystem) if(HPX_FILESYSTEM_WITH_BOOST_FILESYSTEM_COMPATIBILITY)