6#ifndef MIMICPP_UTILITY_HPP
7#define MIMICPP_UTILITY_HPP
14#include <source_location>
21 template <
typename...>
23 :
public std::bool_constant<false>
27 template <std::
size_t priority>
42 const std::source_location& lhs,
43 const std::source_location& rhs
46 return std::string_view{lhs.file_name()} == std::string_view{rhs.file_name()}
47 && std::string_view{lhs.function_name()} == std::string_view{rhs.function_name()}
48 && lhs.line() == rhs.line()
49 && lhs.column() == rhs.column();
52 template <
typename From,
typename To>
56 static_cast<To
>(std::declval<From>());
59 template <
typename From,
typename To>
64 {
static_cast<To
>(std::declval<From>()) }
noexcept;
67 template <
typename T,
typename... Others>
71 requires std::is_enum_v<T>
73 constexpr std::underlying_type_t<T>
to_underlying(
const T value)
noexcept
75 return static_cast<std::underlying_type_t<T>
>(value);
78 template <
typename T,
template <
typename>
typename Trait>
83#ifdef __cpp_lib_unreachable
84 using std::unreachable;
100#if defined(_MSC_VER) && !defined(__clang__)
103 __builtin_unreachable();
123namespace mimicpp::detail
125 template <
typename Parsed,
typename... Rest>
128 template <
typename... Uniques,
typename First,
typename... Others>
130 std::tuple<Uniques...>,
134 using current_t = std::conditional_t<
135 same_as_any<First, Uniques...>,
136 std::tuple<Uniques...>,
137 std::tuple<Uniques..., First>>;
139 using type_t =
typename unique<
144 template <
typename... Uniques>
145 struct unique<std::tuple<Uniques...>>
147 using type_t = std::tuple<Uniques...>;
150 template <
typename... Types>
151 using unique_list_t =
typename unique<std::tuple<>, Types...>::type_t;
Definition Utility.hpp:53
Definition Utility.hpp:60
Definition Utility.hpp:68
Definition Utility.hpp:79
Definition BoostTest.hpp:20
void unreachable()
Invokes undefined behavior.
Definition Utility.hpp:93
constexpr bool is_same_source_location(const std::source_location &lhs, const std::source_location &rhs) noexcept
Definition Utility.hpp:41
ValueCategory
Definition Fwd.hpp:195
constexpr bool is_matching(const Constness lhs, const Constness rhs) noexcept
Definition Utility.hpp:111
Constness
Definition Fwd.hpp:188
constexpr std::underlying_type_t< T > to_underlying(const T value) noexcept
Definition Utility.hpp:73
Definition Utility.hpp:24
Definition Utility.hpp:32