Bug 1957791 - Apply mozilla patches for opentelemetry-cpp r=mvanstraten,jari

Differential Revision: https://phabricator.services.mozilla.com/D244098
This commit is contained in:
Updatebot
2025-04-16 13:39:22 +00:00
parent 26118115e7
commit a3eef0f552
2 changed files with 7 additions and 9 deletions

View File

@@ -10,11 +10,6 @@
#include "opentelemetry/version.h"
OPENTELEMETRY_BEGIN_NAMESPACE
namespace baggage
{
class Baggage;
} // namespace baggage
namespace trace
{
class Span;
@@ -29,7 +24,6 @@ using ContextValue = nostd::variant<nostd::monostate,
uint64_t,
double,
nostd::shared_ptr<trace::Span>,
nostd::shared_ptr<trace::SpanContext>,
nostd::shared_ptr<baggage::Baggage>>;
nostd::shared_ptr<trace::SpanContext>>;
} // namespace context
OPENTELEMETRY_END_NAMESPACE

View File

@@ -220,9 +220,13 @@ inline constexpr bool holds_alternative(const variant<Ts...> &v) noexcept
return v.index() == I;
}
template <typename T, typename... Ts>
inline constexpr bool holds_alternative(const variant<Ts...> &v) noexcept
template <typename T, template<typename...> typename U, typename... Ts>
inline constexpr bool holds_alternative(const U<Ts...> &v) noexcept
{
// Clang 18.1.7 on Ubuntu 24.04 does not disambiguate between this
// and std::holds_alternative if argument type is std::variant<Ts...>
static_assert(std::is_same_v<U<Ts...>, std::variant<Ts...>>,
"Unsupported argument type");
return std::holds_alternative<T, Ts...>(v);
}