#pragma once #include #include namespace sc { template struct lazy_string_format { constexpr static StringConstant str{}; ArgTuple args{}; constexpr lazy_string_format() = default; constexpr lazy_string_format(StringConstant, ArgTuple newArgs) : args{newArgs} {} template constexpr auto apply(F &&f) const { return args.apply( [&](auto const &...as) { return std::forward(f)(str, as...); }); } }; template [[nodiscard]] constexpr auto operator==( lazy_string_format, ArgsTupleLhs> lhs, lazy_string_format, ArgsTupleRhs> rhs) noexcept -> bool { return (lhs.str == rhs.str) && (lhs.args == rhs.args); } template [[nodiscard]] constexpr auto operator+(lazy_string_format lhs, lazy_string_format rhs) noexcept { return lazy_string_format{lhs.str + rhs.str, stdx::tuple_cat(lhs.args, rhs.args)}; } template [[nodiscard]] constexpr auto operator+(lazy_string_format lhs, string_constant rhs) noexcept { return lazy_string_format{lhs.str + rhs, lhs.args}; } template [[nodiscard]] constexpr auto operator+(string_constant lhs, lazy_string_format rhs) noexcept { return lazy_string_format{lhs + rhs.str, rhs.args}; } } // namespace sc