Skip to content

Commit

Permalink
Mark styled_arg as a view to prevent lifetime issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Sep 9, 2023
1 parent a4b7b24 commit 5bdce18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/fmt/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,10 @@ template <typename Char> inline void reset_color(buffer<Char>& buffer) {
buffer.append(reset_color.begin(), reset_color.end());
}

template <typename T> struct styled_arg {
template <typename T> struct styled_arg : detail::view {
const T& value;
text_style style;
styled_arg(const T& v, text_style s) : value(v), style(s) {}
};

template <typename Char>
Expand Down

0 comments on commit 5bdce18

Please sign in to comment.