Skip to content
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

rang::style::reset also resets rang::fg #133

Open
asmaloney opened this issue Mar 18, 2023 · 2 comments
Open

rang::style::reset also resets rang::fg #133

asmaloney opened this issue Mar 18, 2023 · 2 comments

Comments

@asmaloney
Copy link

If I do this:

std::cout << rang::fg::blue << "foo: " << rang::style::bold << "some text"
         << rang::style::reset << " (some more text)" << std::endl;

I get this:

Screen Shot 2023-03-18 at 14 39 48 PM

but since I didn't reset fg, I expected to see this:

Screen Shot 2023-03-18 at 14 40 16 PM

Is this expected behaviour? The docs seem to imply this should not be happening.

@zethon
Copy link

zethon commented Oct 23, 2023

The order of evaluation of the stream elements wasn't specified until C++17. Are you using an older C++ standard?

@asmaloney
Copy link
Author

Even after using it for decades, C++ continues to surprise! 😄

It's quite possible that I was using C++14 at the time. I have since removed rang and just use fmt's styling in favour of fewer dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants