-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add BOOST_SYSTEM_CURRENT_LOCATION_PTR #84
base: develop
Are you sure you want to change the base?
Conversation
Allows passing current location to error_code ctor without requiring a separate static local variable. Implementation uses __builtin_source_location() on clang and gcc returning a pointer to std::source_location::__impl, which we verify is layout-compatible with boost::source_location.
the compiler gets confused whether __builtin_FUNCTION() (and the string it points to) is a compile-time constant, and fails or ICEs. Skip this for now.
don't rely on string folding
for Visual Studio 2015 MSVC 9.0
I'm looking at this and wondering where we want to go with it. Ideally, I'd like to make this macro the default argument of the Looking at the codegen, the first lambda path, the one passing the current location as an argument to the lambda, generates a guard variable. I don't see a way to avoid that, and for me, this kind of rules it out from being silently applied by default. I suppose we could just use the other one, clearing the function name. The Clang path seems a bit dubious; while clang-cl supports Also, Clang using libstdc++ would use its If we consider the _PTR macro an implementation detail that's only used as a default argument, I think we can dispense with the type safety and just use an ordinary pointer. |
Maybe we could just do a little data race: https://godbolt.org/z/fq6ETGqcP |
Allows passing current location to error_code ctor without requiring a separate static local variable.
Implementation uses __builtin_source_location() on clang and gcc returning a pointer to std::source_location::__impl, which we verify is layout-compatible with boost::source_location.