Open C++ Libraries.org develop
Loading...
Searching...
No Matches
hash_fwd.hpp
1// SPDX-License-Identifier: BSL-1.0
2// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org)
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5// Official repository: https://github.com/open-cpp-libraries/core
6
7#ifndef OCL_CORE_BASIC_HASH
8#define OCL_CORE_BASIC_HASH
9
10#include <ocl/detail/config.hpp>
11
13
14namespace ocl
15{
16
18 template <class Type>
20 {
21 using result_type = typename Type::result_type;
22 using type = Type;
23
24 // AMLALE: If it throws, we can't compute the hash correctly.
25 constexpr result_type hash() noexcept
26 {
27 return type{}.hash();
28 }
29 };
30
32 template <>
33 struct basic_hash<bool>
34 {
35 using result_type = bool;
36 using type = bool;
37
38 // AMLALE: If it throws, we can't compute the hash correctly.
39 constexpr result_type hash()
40 {
41 return false;
42 }
43 };
44
45} // namespace ocl
46
47#endif
Memory allocator for OCL support.
Definition allocator_fwd.hpp:16
Hash helper structure.
Definition hash_fwd.hpp:20