You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ContextValue has been recently introduced in SDK. Unfortunately the two nostd::shared_ptr<...> variant members are failing to compile with Visual Studio 2015, due to issue in nostd::variant backport.
This code fails to compile:
using ContextValue = nostd::variant<bool,
int64_t,
uint64_t,
double,
nostd::shared_ptr<trace::Span>,
nostd::shared_ptr<trace::SpanContext>>;
with the following error:
1>c:\work\opentelemetry-cpp\api\include\opentelemetry\nostd\variant.h(168): error C2672: 'opentelemetry::v0::nostd::detail::visitation::base::make_farray': no matching overloaded function found
1>c:\work\opentelemetry-cpp\api\include\opentelemetry\nostd\variant.h(173): note: see reference to class template instantiation 'opentelemetry::v0::nostd::detail::visitation::base::make_fmatrix_impl<F,opentelemetry::v0::nostd::detail::base<opentelemetry::v0::nostd::detail::Trait::Available,bool,int64_t,uint64_t,double,opentelemetry::v0::nostd::shared_ptr<opentelemetry::v0::trace::Span>,opentelemetry::v0::nostd::shared_ptr<opentelemetry::v0::trace::SpanContext>> &>::impl<opentelemetry::v0::nostd::integer_sequence<std::size_t>,opentelemetry::v0::nostd::integer_sequence<std::size_t>>' being compiled
whereas a simpler definition of the variant that does not use nostd::shared_ptr - compiles successfully:
using ContextValue = nostd::variant < bool, int64_t, uint64_t, double>;
The issue is in a way how nostd::variant backport handles complex objects. Primitive types are OK.
There could be a few alternative solutions to this issue:
declare that we cannot support Visual Studio 2015
declare that RuntimeContext API does not work with Visual Studio 2015
simplify the implementation to avoid positioning complex objects on variant, possibly using raw pointers instead
fix an issue in implementation of nostd::detail::visitation::base
ContextValuehas been recently introduced in SDK. Unfortunately the twonostd::shared_ptr<...>variant members are failing to compile with Visual Studio 2015, due to issue innostd::variantbackport.This code fails to compile:
with the following error:
whereas a simpler definition of the variant that does not use
nostd::shared_ptr- compiles successfully:The issue is in a way how
nostd::variantbackport handles complex objects. Primitive types are OK.There could be a few alternative solutions to this issue:
raw pointersinsteadnostd::detail::visitation::basenostd::variantwithabsl::variant( somewhat related to [WIP] Ability to use Standard Library as a substitute for nostd:: classes #275 - ability to substitutenostdwith alternate implementation )