StormByte C++ Library 1.2.0
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
Loading...
Searching...
No Matches
comparison.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte.
5 *
6 * StormByte is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
22#include <concepts>
23#include <cstddef>
24#include <functional>
25#include <type_traits>
26
31namespace StormByte {
32 namespace Type {
51 template<typename T>
53 requires(std::remove_cvref_t<T> const& a, std::remove_cvref_t<T> const& b) {
54 { a == b } -> std::convertible_to<bool>;
55 { a != b } -> std::convertible_to<bool>;
56 };
57
67 template<typename T>
69 requires(std::remove_cvref_t<T> const& a, std::remove_cvref_t<T> const& b) {
70 { a <=> b };
71 };
72
82 template<typename T>
83 concept Hashable =
84 requires(std::remove_cvref_t<T> const& t) {
85 { std::hash<std::remove_cvref_t<T>>{}(t) } -> std::convertible_to<std::size_t>;
86 };
88 }
89}
Type whose == and != both yield something convertible to bool.
Definition comparison.hxx:52
Type with a valid std::hash specialization.
Definition comparison.hxx:83
Type whose <=> operator is well-formed.
Definition comparison.hxx:68
Root namespace of the StormByte suite.