potential fix for std::variant implicit conversion in C++17 STL#734
potential fix for std::variant implicit conversion in C++17 STL#734lalitb wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #734 +/- ##
=======================================
Coverage 96.00% 96.01%
=======================================
Files 176 176
Lines 7183 7199 +16
=======================================
+ Hits 6896 6912 +16
Misses 287 287
|
maxgolov
left a comment
There was a problem hiding this comment.
I'm Okay with this as a temporary measure. I think we could have handled it in the AttributeValue class. I think the issue is that since it's a non-owning and always creates a string_view - this causes some odd issues with temporary arrays of chars..
This is not related to |
|
|
||
| // Set resources for this log record only of type <string, string> | ||
| record->SetResource("key1", "val1"); | ||
| record->SetResource("key1", std::string("val1")); |
There was a problem hiding this comment.
Could we provide an explicit overload to SetResource with const char * to avoid potential future error?
There was a problem hiding this comment.
I don't like that. I'm proposing to re-add const char * to variant. Just verified that it works, and including it in the Abseil Variant PR.
This re-add of const char * will give us much nicer user / developer experience, when we get to C++17 standard lib impl of variant.
Just to understand, we are seeing this issue both with C++17 STL and absl::variant, and mpark::variant handles this nicely ? |
Sure closing this PR. |
Fixes ##733
Changes
@maxgolov This is not for merge, but to showcase the potential changes needed to fix #733, As mentioned in the comment there, this is not related to resource sdk.
CHANGELOG.mdupdated for non-trivial changes