Skip to content

Commit e28b094

Browse files
committed
add make fmt::formatter() const
otherwise the tree fails to build: ``` /usr/include/fmt/base.h:1392:29: error: passing ‘const fmt::v11::formatter<boxed::detail::boxed<unsigned int, vtpty::detail::tags::Width>, char, void>’ as ‘this’ argument discards qualifiers [-fpermissive] 1392 | ctx.advance_to(cf.format(*static_cast<qualified_type*>(arg), ctx)); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/boxed-cpp/boxed.hpp:219:10: note: in call to ‘auto fmt::v11::formatter<boxed::detail::boxed<T, Tag> >::format(const boxed::detail::boxed<T, Tag>&, fmt::v11::format_context&) [with Type = unsigned int; Tag = vtpty::detail::tags::Width; fmt::v11::format_context = fmt::v11::context]’ 219 | auto format(boxed::detail::boxed<Type, Tag> const& val, fmt::format_context& ctx) | ^~~~~~ ``` Signed-off-by: Kefu Chai <[email protected]>
1 parent fe2f8bb commit e28b094

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/boxed-cpp/boxed.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ struct fmt::formatter<boxed::detail::boxed<Type, Tag>>
217217
{
218218
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
219219

220-
auto format(boxed::detail::boxed<Type, Tag> const& val, fmt::format_context& ctx)
220+
auto format(boxed::detail::boxed<Type, Tag> const& val, fmt::format_context& ctx) const
221221
{
222222
return fmt::format_to(ctx.out(), "{}", val.value);
223223
}

0 commit comments

Comments
 (0)