-
Notifications
You must be signed in to change notification settings - Fork 3
rsl::format #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
rsl::format #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, great addition to the library, also need to find a place for the documentation, at least some minimal
# add_executable(example_review | ||
# review.cpp | ||
# review_tu2.cpp | ||
# ) | ||
# target_link_libraries(example_review PRIVATE rsl_util) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just remove it, no need for keeping commented out code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I should probably re-enable that. I think something there broke, gonna take a look in a different PR
[[nodiscard]] std::string with_style(StyleMap const& style) const { | ||
return (this->*join)(&style); | ||
} | ||
[[nodiscard]] std::string unstyled() const { return (this->*join)(nullptr); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess better to have more consistent naming, if we have with_style
than unstyled
should be without_style
, or the with_style
should become styled
} | ||
|
||
if (!consume(']')) { | ||
// std::println("missing closing ]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove before merging
consteval explicit operator std::meta::info() const { | ||
auto args = std::vector<rsl::string_view>(); | ||
for (auto const& tag : tags) { | ||
args.emplace_back(std::define_static_string(tag)); | ||
} | ||
return std::meta::reflect_constant(Tag{std::define_static_array(args), enable}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, this is interesting hack
std::vector<std::string_view> names = nonstatic_data_members_of(type, std::meta::access_context::current()) | | ||
std::views::transform(std::meta::identifier_of) | | ||
std::ranges::to<std::vector>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, will this get cached for the same type as with template instantiation or this will be evaluated every time ?
{"magenta", "\x1b[35m"}, | ||
{ "cyan", "\x1b[36m"}, | ||
{ "white", "\x1b[37m"}, | ||
{"default", "\x1b[3m8"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
No description provided.