OpenKalman
object-concepts.hpp
Go to the documentation of this file.
1 /* This file is part of OpenKalman, a header-only C++ library for
2  * Kalman filters and other recursive filters.
3  *
4  * Copyright (c) 2021-2025 Christopher Lee Ogden <ogden@gatech.edu>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
9  */
10 
16 #ifndef OPENKALMAN_COMPATIBILITY_OBJECT_CONCEPTS_HPP
17 #define OPENKALMAN_COMPATIBILITY_OBJECT_CONCEPTS_HPP
18 
19 #include "core-concepts.hpp"
20 #include "comparison.hpp"
21 #include "common.hpp"
22 
23 namespace OpenKalman::stdex
24 {
25 #ifdef __cpp_lib_concepts
26  using std::movable;
27  using std::copyable;
28  using std::semiregular;
29  using std::regular;
30 #else
31  template<typename T>
32  inline constexpr bool
33  movable =
34  std::is_object_v<T> and
35  std::is_move_constructible_v<T> and
36  std::is_assignable_v<T&, T> and
37  swappable<T>;
38 
39 
40  template<typename T>
41  inline constexpr bool
42  copyable =
43  copy_constructible<T> and
44  movable<T> and
45  std::is_assignable_v<T&, T&> and
46  std::is_assignable_v<T&, const T&> and
47  std::is_assignable_v<T&, const T>;
48 
49 
50  template<typename T>
51  inline constexpr bool
52  semiregular = copyable<T> and default_initializable<T>;
53 
54 
55  template<typename T>
56  inline constexpr bool
57  regular = semiregular<T> and equality_comparable<T>;
58 
59 #endif
60 
61 }
62 
63 #endif
Definitions relating to c+++20+ comparisons.
Definitions relating to standard c++ library concepts.
Definition: basics.hpp:55