Use std::index_sequence_for<Ts...> instead of std::make_index_sequence<sizeof...(Ts)>
This commit is contained in:
parent
e6f988f320
commit
53ed6a22e9
4 changed files with 7 additions and 8 deletions
|
@ -2,9 +2,9 @@
|
|||
#include <fmt/core.h>
|
||||
|
||||
namespace utempl {
|
||||
template <std::size_t>
|
||||
struct ConstexprString;
|
||||
};
|
||||
template <std::size_t>
|
||||
struct ConstexprString;
|
||||
} // namespace utempl
|
||||
|
||||
template <std::size_t Size>
|
||||
struct fmt::formatter<utempl::ConstexprString<Size>> : public fmt::formatter<std::string_view> {
|
||||
|
@ -37,7 +37,6 @@ struct ConstexprString {
|
|||
inline constexpr ConstexprString() = default;
|
||||
inline constexpr ConstexprString(const char (&data)[Size]) : data{} {
|
||||
std::ranges::copy_n(data, Size, this->data.begin());
|
||||
|
||||
};
|
||||
inline constexpr ConstexprString(std::string data) : data{} {
|
||||
std::ranges::copy_n(data.begin(), Size, this->data.begin());
|
||||
|
|
|
@ -78,7 +78,7 @@ struct Menu {
|
|||
return [&]<auto... Is>(std::index_sequence<Is...>){
|
||||
constexpr auto list = ListFromTuple(storage);
|
||||
return GetMax(std::array{(std::remove_cvref_t<decltype(*std::declval<decltype(Get<Is>(list))>().need)>::kSize != 0 ? std::remove_cvref_t<decltype(*std::declval<decltype(Get<Is>(list))>().need)>::kSize : CountDigits(Is))...});
|
||||
}(std::make_index_sequence<sizeof...(Fs)>());
|
||||
}(std::index_sequence_for<Fs...>());
|
||||
};
|
||||
template <impl::CallbackMessage message, std::invocable F>
|
||||
constexpr auto With(F&& f) const {
|
||||
|
@ -129,7 +129,7 @@ struct Menu {
|
|||
};
|
||||
};
|
||||
}(Wrapper<Is>{}), ...);
|
||||
}(std::make_index_sequence<sizeof...(Fs)>());
|
||||
}(std::index_sequence_for<Fs...>());
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ struct Tuple : public impl::TupleHelper<std::index_sequence_for<Ts...>, Ts...> {
|
|||
inline constexpr auto operator+(const Tuple<TTs...>& other) const -> Tuple<Ts..., TTs...> {
|
||||
return [&]<auto... Is, auto... IIs>(std::index_sequence<Is...>, std::index_sequence<IIs...>) -> Tuple<Ts..., TTs...> {
|
||||
return {Get<Is>(*this)..., Get<IIs>(other)...};
|
||||
}(std::make_index_sequence<sizeof...(Ts)>(), std::make_index_sequence<sizeof...(TTs)>());
|
||||
}(std::index_sequence_for<Ts...>(), std::index_sequence_for<TTs...>());
|
||||
};
|
||||
template <auto I>
|
||||
inline constexpr auto operator[](Wrapper<I>) const -> const auto& {
|
||||
|
|
|
@ -52,7 +52,7 @@ template <typename... Ts>
|
|||
consteval auto Reverse(TypeList<Ts...> list) {
|
||||
return [&]<auto... Is>(std::index_sequence<Is...>) -> TypeList<decltype(Get<sizeof...(Ts) - Is - 1>(list))...> {
|
||||
return {};
|
||||
}(std::make_index_sequence<sizeof...(Ts)>());
|
||||
}(std::index_sequence_for<Ts...>());
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
|
|
Loading…
Reference in a new issue