alpaqa 1.0.0a13
Nonconvex constrained optimization
Loading...
Searching...
No Matches
type-traits.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4#include <memory>
5#include <type_traits>
6
7namespace alpaqa::util {
8
9template <class M>
11
12template <class C, class Ret, class... Args>
13struct class_from_member_ptr_impl<Ret (C::*)(Args...)> {
14 using type = C;
15};
16
17template <class C, class Ret, class... Args>
18struct class_from_member_ptr_impl<Ret (C::*)(Args...) const> {
19 using type = std::add_const_t<C>;
20};
21
22template <class M>
25
26template <auto M>
28
29template <class First, class... Pack>
30struct last_type {
31 using type = typename last_type<Pack...>::type;
32};
33template <class Only>
34struct last_type<Only> {
35 using type = Only;
36};
37template <class... Pack>
38using last_type_t = typename last_type<Pack...>::type;
39
40template <class... Pack>
42template <class First, class... Pack>
44 using type = First;
45};
46template <>
48 using type = void;
49};
50template <class... Pack>
51using first_type_or_void_t = typename first_type_or_void<Pack...>::type;
52
53template <class... Pack>
55 !std::is_same_v<std::remove_cvref_t<first_type_or_void_t<Pack...>>,
56 std::allocator_arg_t>;
57
58} // namespace alpaqa::util
typename class_from_member_ptr_impl< M >::type class_from_member_ptr_impl_t
class_from_member_ptr_impl_t< decltype(M)> class_from_member_ptr_t
typename last_type< Pack... >::type last_type_t
typename last_type< Pack... >::type type
typename first_type_or_void< Pack... >::type first_type_or_void_t
constexpr const auto inf
Definition config.hpp:85