Skip to content

Commit 2a31457

Browse files
Copilotjll63
andcommitted
Move uintptr definitions to separate namespace declaration
Co-authored-by: jll63 <[email protected]>
1 parent 8e16037 commit 2a31457

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

include/boost/openmethod/policies/minimal_perfect_hash.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
#pragma warning(disable : 4702) // unreachable code
1818
#endif
1919

20+
namespace boost::openmethod::detail {
21+
22+
#if defined(UINTPTR_MAX)
23+
using uintptr = std::uintptr_t;
24+
constexpr uintptr uintptr_max = UINTPTR_MAX;
25+
#else
26+
static_assert(
27+
sizeof(std::size_t) == sizeof(void*),
28+
"This implementation requires that size_t and void* have the same size.");
29+
using uintptr = std::size_t;
30+
constexpr uintptr uintptr_max = (std::numeric_limits<std::size_t>::max)();
31+
#endif
32+
33+
} // namespace boost::openmethod::detail
34+
2035
namespace boost::openmethod {
2136

2237
namespace detail {

0 commit comments

Comments
 (0)