23 if constexpr (
sizeof... (strings))
24 return first + ((
sep + strings) + ...);
31 return std::apply ([&
sep]<
typename... Ts> (Ts&&... args) {
return Join (
sep, std::forward<Ts> (args)...); },
35 template<
typename Tup1,
typename Tup2,
36 size_t Tup1Size = std::tuple_size_v<std::decay_t<Tup1>>,
37 size_t Tup2Size = std::tuple_size_v<std::decay_t<Tup2>>
42 return [&]<
size_t... I> (std::index_sequence<I...>)
44 return std::tuple { (std::get<I> (tup1) +
sep + std::get<I> (tup2))... };
45 } (std::make_index_sequence<Tup1Size> {});
50 template<
typename T1,
typename T2>
51 consteval
bool JMEq (
const T1& v1,
const T2& v2)
53 if constexpr (!std::is_same_v<T1, T2>)
60 template<const auto& F>
63 constexpr
auto tup = F ();
64 constexpr
auto indices = std::make_index_sequence<std::tuple_size_v<decltype (tup)>> {};
66 return [&]<std::size_t... Ix> (std::index_sequence<Ix...>)
68 return std::tuple_cat ([&]
70 constexpr
auto thisIndex = Ix;
71 constexpr
auto item = std::get<thisIndex> (
tup);
73 constexpr
auto itemResult = [&]<std::size_t... IxOther> (std::index_sequence<IxOther...>)
75 if constexpr (((
detail::JMEq (item, std::get<IxOther> (
tup)) && IxOther < thisIndex) || ...))
78 return std::tuple { item };
85 template<
size_t N,
typename Char>
86 QDebug operator<< (QDebug dbg, const CtString<N, Char>& str)
88 QDebugStateSaver saver { dbg };
89 dbg.nospace () <<
"CtString[" << N <<
"] { ";
90 for (
size_t i = 0; i < N; ++i)
91 dbg.nospace () << str.Data_ [i];
92 dbg.nospace () <<
" }";
constexpr auto Join(auto &&) noexcept
constexpr auto JoinTup(auto &&stringsTuple, auto &&sep) noexcept
const std::tuple< Args... > & tup
consteval bool JMEq(const T1 &v1, const T2 &v2)
requires(Tup1Size==Tup2Size) const expr auto ZipWith(Tup1 &&tup1
auto Tup2 &&tup2 noexcept
auto ZipWith(const Container< T1 > &c1, const Container< T2 > &c2, F f) -> WrapType_t< Container< std::decay_t< std::result_of_t< F(T1, T2)>>>>