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

Use constinit in logs.cpp #16287

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Use constinit in logs.cpp #16287

wants to merge 6 commits into from

Conversation

Nekotekina
Copy link
Member

Not sure if it will compile yet.

Not sure if it will compile yet.
@Megamouse
Copy link
Contributor

you could probably do something like this for now?

image

@elad335
Copy link
Contributor

elad335 commented Nov 5, 2024

Or put the decleration out of the function

@Nekotekina
Copy link
Member Author

Or put the decleration out of the function

I don't think it matters, it's some compiler support problem that blocks constexpr default constructor (should be in c++20)

@Megamouse
Copy link
Contributor

My suggestion compiles on msvc at least (no idea if it's better than the current code)

Use unique_ptr wrapper
Fix std::string reuse
if (!args_)
args_ = std::make_unique<std::vector<u64>>();
auto& text = *text_.get();
auto& args = *args_.get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think .get is needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, okay, it isn't

@Nekotekina
Copy link
Member Author

Damn MSVC what the hell

@elad335 elad335 added Miscellaneous Optimization Optimizes existing code labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Miscellaneous Optimization Optimizes existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants