68 Format(
const std::string& form,
const std::tuple<Ts...>& tuple)
71#pragma GCC diagnostic push
72#pragma GCC diagnostic ignored "-Wformat-security"
74 int sz = std::snprintf(buff,
sizeof(buff), form.c_str(), std::get<Is>(tuple)...);
75 if (0 < sz &&
static_cast<std::size_t
>(sz) <
sizeof(buff))
79 std::vector<char> buffd(sz + 1);
80 if (std::snprintf(buff,
sizeof(buff), form.c_str(), std::get<Is>(tuple)...) != sz)
82 throw std::logic_error{__FILE__
" " + std::to_string(__LINE__) +
83 " std::snprintf behaved unexpectedly"};
85#pragma GCC diagnostic pop