17 #ifndef OPENKALMAN_ADAPTERBASE_HPP 18 #define OPENKALMAN_ADAPTERBASE_HPP 20 #include "linear-algebra/traits/internal/library_base.hpp" 32 template<
typename Derived, indexible Nested, indexible LibraryObject = Nested> requires
33 (not std::is_rvalue_reference_v<Nested>)
35 template<
typename Derived,
typename Nested,
typename LibraryObject = Nested>
40 #ifndef __cpp_concepts 41 static_assert(indexible<Nested>);
42 static_assert(indexible<LibraryObject>);
43 static_assert(not std::is_rvalue_reference_v<Nested>);
57 template<
typename Arg> requires
58 (not std::is_base_of_v<Derived, std::decay_t<Arg>>) and
59 std::constructible_from<Nested, Arg&&>
61 template<
typename Arg, std::enable_if_t<
62 (not std::is_base_of_v<Derived, std::decay_t<Arg>>) and
63 stdex::constructible_from<Nested, Arg&&>,
int> = 0>
72 #ifdef __cpp_explicit_this_parameter 73 template<
typename Self>
74 constexpr decltype(
auto)
nested_object(
this Self&&
self) {
return std::forward<Self>(
self).nested_; }
82 constexpr Nested&&
nested_object() && {
return std::move(*this).nested_; }
85 constexpr
const Nested&&
nested_object() const && {
return std::move(*this).nested_; }
Definition: AdapterBase.hpp:37
constexpr AdapterBase()=default
Default constructor.
constexpr Nested & nested_object() &
Get the nested object.
Definition: AdapterBase.hpp:76
constexpr const Nested && nested_object() const &&
Definition: AdapterBase.hpp:85
constexpr AdapterBase(Arg &&arg)
Construct from the nested type.
Definition: AdapterBase.hpp:66
constexpr Nested && nested_object() &&
Definition: AdapterBase.hpp:82
Definition: basics.hpp:48
constexpr const Nested & nested_object() const &
Definition: AdapterBase.hpp:79