Repository navigation
Conversation
opentelemetry-cpp's nostd::variant and nostd::string_view are aliases
for std::variant and std::string_view only when opentelemetry-cpp is
built with WITH_STL. With the default (non-STL) build they are
opentelemetry-cpp's own types, and calling std::visit, std::get or
std::holds_alternative on them, or passing a std::string_view where a
nostd::string_view is expected, fails to compile.
Use opentelemetry::nostd::{visit,get,holds_alternative} and an explicit
nostd::string_view conversion, as other parts of the code (e.g.
bigtable and storage monitoring) already do. This works with both STL
and non-STL builds of opentelemetry-cpp.
There was a problem hiding this comment.
Code Review
This pull request replaces standard library components such as std::visit, std::holds_alternative, std::get, and implicit string conversions with their OpenTelemetry non-standard equivalents (opentelemetry::nostd::visit, opentelemetry::nostd::holds_alternative, opentelemetry::nostd::get, and opentelemetry::nostd::string_view) across several tracing and telemetry internal source files. I have no feedback to provide as the changes are consistent and correct.
|
/gcbrun |
|
/gharun |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16624 +/- ##
==========================================
- Coverage 92.51% 92.50% -0.02%
==========================================
Files 2269 2269
Lines 222804 222805 +1
==========================================
- Hits 206126 206101 -25
- Misses 16678 16704 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/gcbrun |
opentelemetry-cpp's nostd::variant and nostd::string_view are aliases for std::variant and std::string_view only when opentelemetry-cpp is built with WITH_STL. With the default (non-STL) build they are opentelemetry-cpp's own types, and calling std::visit, std::get or std::holds_alternative on them, or passing a std::string_view where a nostd::string_view is expected, fails to compile.
Use opentelemetry::nostd::{visit,get,holds_alternative} and an explicit nostd::string_view conversion, as other parts of the code (e.g. bigtable and storage monitoring) already do. This works with both STL and non-STL builds of opentelemetry-cpp.