Skip to content

Commit 6e33bff

Browse files
fix includes, macro guards, and test header
1 parent 2e6decb commit 6e33bff

4 files changed

Lines changed: 14 additions & 16 deletions

File tree

libs/core/type_support/include/hpx/type_support/is_replaceable.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@
1111
#include <cstddef>
1212
#include <type_traits>
1313

14-
#include <hpx/type_support/is_trivially_relocatable.hpp>
15-
1614
namespace hpx::experimental {
1715

18-
// P2786R13 defines a single feature-test macro __cpp_trivial_relocatability
19-
// that covers both the core-language keyword and the associated library traits
20-
// (std::is_trivially_relocatable, std::is_replaceable, std::relocate_at).
21-
// The language and library features are bundled in one proposal, so guarding on
22-
// this macro is sufficient to confirm that std::is_replaceable is available.
23-
#if defined(__cpp_trivial_relocatability)
16+
// std::is_replaceable is a library trait introduced by P2786R13.
17+
// Guard its use on the library feature-test macro __cpp_lib_trivially_relocatable
18+
// rather than the core-language macro __cpp_trivial_relocatability, since the
19+
// standard library may not ship the trait even when the language keyword is
20+
// available (or vice versa).
21+
#if defined(__cpp_lib_trivially_relocatable)
2422
HPX_CXX_CORE_EXPORT template <typename T>
2523
struct is_replaceable : std::is_replaceable<T>
2624
{

libs/core/type_support/include/hpx/type_support/is_trivially_relocatable.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212

1313
namespace hpx::experimental {
1414

15-
// P2786R13 defines a single feature-test macro __cpp_trivial_relocatability
16-
// that covers both the core-language keyword and the associated library traits
17-
// (std::is_trivially_relocatable, std::is_replaceable, std::relocate_at).
18-
// The language and library features are bundled in one proposal, so guarding on
19-
// this macro is sufficient to confirm that std::is_trivially_relocatable is
20-
// available.
21-
#if defined(__cpp_trivial_relocatability)
15+
// std::is_trivially_relocatable is a library trait introduced by P2786R13.
16+
// Guard its use on the library feature-test macro __cpp_lib_trivially_relocatable
17+
// rather than the core-language macro __cpp_trivial_relocatability, since the
18+
// standard library may not ship the trait even when the language keyword is
19+
// available (or vice versa).
20+
#if defined(__cpp_lib_trivially_relocatable)
2221
template <typename T>
2322
struct is_trivially_relocatable : std::is_trivially_relocatable<T>
2423
{

libs/core/type_support/include/hpx/type_support/relocate_at.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <concepts>
1515
#include <cstring>
16+
#include <memory>
1617
#include <type_traits>
1718

1819
namespace hpx::detail {

libs/core/type_support/tests/unit/is_replaceable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7-
#include <hpx/type_support/is_replaceable.hpp>
7+
#include <hpx/modules/type_support.hpp>
88

99
#include <cassert>
1010
#include <memory>

0 commit comments

Comments
 (0)