@@ -267,13 +267,15 @@ namespace tui {
267267
268268// generate for cout << STYLE_style(); eg.: cout << bold_style();
269269#define stylize (STYLE ) \
270- inline std::string STYLE##_style() { return style (Style::STYLE); }
270+ static inline std::string STYLE##_style() { return style (Style::STYLE); }
271271// generate for cout << STYLE_style(text); eg.: cout << bold_style(text);
272272#define stylize_text (STYLE ) \
273- inline std::string STYLE##_style(const std::string& text) { \
273+ static inline std::string STYLE##_style(const std::string& text) { \
274274 return concat (style (Style::STYLE), text, reset_style ()); \
275275 } \
276- inline std::string STYLE##_style(const char * text) { return concat (style (Style::STYLE), text, reset_style ()); }
276+ static inline std::string STYLE##_style(const char * text) { \
277+ return concat (style (Style::STYLE), text, reset_style ()); \
278+ }
277279// generate all
278280#define make_stylizer (STYLE ) stylize(STYLE) stylize_text(STYLE)
279281
@@ -325,22 +327,22 @@ namespace tui {
325327
326328// generate for cout << COLOR_{fg, bg}();
327329#define colorize (COLOR ) \
328- inline std::string COLOR##_fg() { return colorizer (Color::COLOR, true ); } \
329- inline std::string COLOR##_bg() { return colorizer (Color::COLOR, false ); }
330+ static inline std::string COLOR##_fg() { return colorizer (Color::COLOR, true ); } \
331+ static inline std::string COLOR##_bg() { return colorizer (Color::COLOR, false ); }
330332
331333// generate for cout << COLOR_{fg, bg}(text);
332334#define colorize_text (COLOR ) \
333- inline std::string COLOR##_fg(const std::string& text) { \
334- return concat (colorizer (Color::COLOR, true ), text, style::reset_style ()); \
335+ static inline std::string COLOR##_fg(const std::string& text) { \
336+ return concat (colorizer (Color::COLOR, true ), text, style::reset_style ()); \
335337 } \
336- inline std::string COLOR##_fg(const char * text) { \
337- return concat (colorizer (Color::COLOR, true ), text, style::reset_style ()); \
338+ static inline std::string COLOR##_fg(const char * text) { \
339+ return concat (colorizer (Color::COLOR, true ), text, style::reset_style ()); \
338340 } \
339- inline std::string COLOR##_bg(const std::string& text) { \
340- return concat (colorizer (Color::COLOR, false ), text, style::reset_style ()); \
341+ static inline std::string COLOR##_bg(const std::string& text) { \
342+ return concat (colorizer (Color::COLOR, false ), text, style::reset_style ()); \
341343 } \
342- inline std::string COLOR##_bg(const char * text) { \
343- return concat (colorizer (Color::COLOR, false ), text, style::reset_style ()); \
344+ static inline std::string COLOR##_bg(const char * text) { \
345+ return concat (colorizer (Color::COLOR, false ), text, style::reset_style ()); \
344346 }
345347
346348// generate all
@@ -408,11 +410,9 @@ namespace tui {
408410 make_color (basic);
409411#undef make_color
410412
411- inline string link (const char * link) { return text::style::link (link, *this ); }
412- inline string rgb (unsigned r, unsigned g, unsigned b) const { return text::color::rgb (r, g, b, true , *this ); }
413- inline string on_rgb (unsigned r, unsigned g, unsigned b) const {
414- return text::color::rgb (r, g, b, false , *this );
415- }
413+ string link (const char * link) { return text::style::link (link, *this ); }
414+ string rgb (unsigned r, unsigned g, unsigned b) const { return text::color::rgb (r, g, b, true , *this ); }
415+ string on_rgb (unsigned r, unsigned g, unsigned b) const { return text::color::rgb (r, g, b, false , *this ); }
416416 };
417417
418418 // void handle_resize(int /*sig*/) { screen::clear(); }
0 commit comments