79121908

Date: 2024-10-24 12:41:50
Score: 2.5
Natty:
Report link

Based on @Shuangcheng Ni 's answer

https://stackoverflow.com/a/76429895/21686566

, a simple modification has been made to support the use of empty print2();

print2();
template <size_t _Cnt>
consteval auto make_format_string_placeholders() -> std::array<char, _Cnt * 2 + 1>
{
    return []<size_t... _Idx>(std::integer_sequence<size_t, _Idx...> &&) {
        return std::array{ (_Idx % 2 == 0 ? '{' : '}')..., '\0' };
    }(std::make_index_sequence<_Cnt * 2>{});
}
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Has code block (-0.5):
  • User mentioned (1): @Shuangcheng
  • Low reputation (1):
Posted by: Kinly