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
This is an issue for my use case since v1.17.0 as the return type of e.g. std::unique_ptr<opentelemetry::sdk::logs::LoggerProvider> LoggerProviderFactory::Create(...) changed. My fix is to introduce
nostd::shared_ptr has constructor for std::unique_ptr<T> &&other, so it can be constructed with the rvalue of std::unique_ptr<T>, just like std::shared_ptr.
Could you please provide the codes that can not compile? I think the problem for nostd::shared_ptr mey be it should be allow to be constructed by not only std::unique_ptr<T>, but also std::unique_ptr<T, Dtor>.
I had a look again at one of the examples (examples/simple/main.cc). And that shows how this can be done without any problems. The basic idea is that you create a std::shared_ptr already from the return object of Create. And from there it just works.
Linux: debian bookworm, GCC 12.2.0
The nostd::shared_ptr class does not support creation from a std::unique_ptr whereas std::shared_ptr supports that. What missing is a constructor and assignment operator, see
(13)
at https://en.cppreference.com/w/cpp/memory/shared_ptr/shared_ptr and(6)
at https://en.cppreference.com/w/cpp/memory/shared_ptr/operator%3D.This is an issue for my use case since v1.17.0 as the return type of e.g.
std::unique_ptr<opentelemetry::sdk::logs::LoggerProvider> LoggerProviderFactory::Create(...)
changed. My fix is to introduceand the use it like
or am I doing something wrong?
The text was updated successfully, but these errors were encountered: