stellarlib 0.1.0
Loading...
Searching...
No Matches
any_set.hpp
1/* clang-format off */
2
3/*
4 stellarlib
5 Copyright (C) 2025-2026 Domán Zana
6
7 This software is provided 'as-is', without any express or implied
8 warranty. In no event will the authors be held liable for any damages
9 arising from the use of this software.
10
11 Permission is granted to anyone to use this software for any purpose,
12 including commercial applications, and to alter it and redistribute it
13 freely, subject to the following restrictions:
14
15 1. The origin of this software must not be misrepresented; you must not
16 claim that you wrote the original software. If you use this software
17 in a product, an acknowledgment in the product documentation would be
18 appreciated but is not required.
19 2. Altered source versions must be plainly marked as such, and must not be
20 misrepresented as being the original software.
21 3. This notice may not be removed or altered from any source distribution.
22*/
23
24#ifndef STELLARLIB_ECS_ANY_SET_HPP
25#define STELLARLIB_ECS_ANY_SET_HPP
26
27namespace stellarlib::ecs::internal
28{
29template <typename Key>
30class any_set
31{
32public:
33 virtual constexpr ~any_set() noexcept = 0;
34
35 virtual constexpr void erase(Key) noexcept = 0;
36
37 virtual constexpr void clear() noexcept = 0;
38
39protected:
40 [[nodiscard]]
41 constexpr any_set() noexcept = default;
42
43 [[nodiscard]]
44 constexpr any_set(const any_set &) noexcept = default;
45
46 [[nodiscard]]
47 constexpr any_set(any_set &&) noexcept = default;
48
49 constexpr auto operator=(const any_set &) noexcept
50 -> any_set & = default;
51
52 constexpr auto operator=(any_set &&) noexcept
53 -> any_set & = default;
54};
55
56template <typename Key>
57constexpr any_set<Key>::~any_set() noexcept = default;
58}
59
60#endif