I'm writing a little helper class, which uses a basic_memory_buffer<char, SIZE> buffer
internally and does multiple calls to format_to(std::back_inserter(buffer), fmt, args...)
throughout it's lifetime.
Eventually the buffer content is retrieved as a string using the following function:
template <size_t SIZE>
FMT_NODISCARD auto to_string(basic_memory_buffer<char, SIZE>& buf)
-> std::string {
auto size = buf.size();
detail::assume(size < std::string().max_size());
return {buf.data(), size};
}
Since both operations size() and data() are declared const it should be possible to make buf const, doesn't it?
Since the parameter buf
is const
in my case, it is trying to using the generic overload
template <typename T, FMT_ENABLE_IF(detail::use_format_as<T>::value)>
FMT_NODISCARD auto to_string(const T& value) -> std::string {
return to_string(format_as(value));
}
which then results in a compilation error, stating that "parse"
is not a member of "fmt::v11::formatter<T,char,void>"
.
Therefore I either have to
As of writing this question I found out that this change was made quite recently with the commit
ab8f9d5?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4