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

InitGoogleLoggingUtilities arg0 lifetime problem #633

Open
xiaobfly opened this issue Apr 2, 2021 · 2 comments · May be fixed by #634
Open

InitGoogleLoggingUtilities arg0 lifetime problem #633

xiaobfly opened this issue Apr 2, 2021 · 2 comments · May be fixed by #634

Comments

@xiaobfly
Copy link
Contributor

xiaobfly commented Apr 2, 2021

Please create a separate PR for this issue.

Originally posted by @sergiud in #631 (comment)

This was referenced Apr 2, 2021
@sergiud sergiud linked a pull request Apr 11, 2021 that will close this issue
@sergiud
Copy link
Collaborator

sergiud commented Apr 13, 2021

Thank you for your contribution.

However, I'm not sure this is the way we should fix the problem. I'd like to avoid unnecessary copying. This means, if the user passes a const char* we should store it as is. An overload should take care of an std::string argument.

Using C++17 std::variant would allow to solve the issue in a uniform way. Alternatively, we could use C++11 unrestricted unions.

@drigz Any thoughts?

@drigz
Copy link
Member

drigz commented Apr 13, 2021

I'm afraid I don't have a ton of C++ experience, so I can't trade off between the additional copy and the complexity of the variant/union approaches.

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

Successfully merging a pull request may close this issue.

3 participants