Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

expected compilation errors #39

Closed
isaachier opened this issue Nov 12, 2017 · 5 comments
Closed

expected compilation errors #39

isaachier opened this issue Nov 12, 2017 · 5 comments

Comments

@isaachier
Copy link
Contributor

isaachier commented Nov 12, 2017

Keep seeing this anytime I try to get the result of Extract into a unique_ptr object using std::move.

expected.hpp:666:39: error: could not convert 
‘((opentracing::expected<std::unique_ptr<opentracing::v1::SpanContext> >*)this)- >
opentracing::expected<std::unique_ptr<opentracing::v1::SpanContext>>::contained.opentracing::
expected_detail::storage_t<std::unique_ptr<opentracing::v1::SpanContext>, std::error_code>::error()’ 
from ‘opentracing::expected_detail::storage_t<std::unique_ptr<opentracing::v1::SpanContext>, 
std::error_code>::error_type {aka std::error_code}’ to ‘std::__exception_ptr::exception_ptr’
@rnburn
Copy link
Contributor

rnburn commented Nov 12, 2017

Could you also give the line that produces that error?

@isaachier
Copy link
Contributor Author

Sorry I have been lazy about this. Here is usually the issue:

auto result = tracer->Extract(reader);
auto ctx = std::move(result.value());

@isaachier
Copy link
Contributor Author

Just confirmed in one of my https://github.com/jaegertracing/cpp-client test cases. That is why my test cases usually do this instead:

auto result = tracer->Extract(reader);
auto ctx = std::unique_ptr<SpanContext>(result->release());

@rnburn
Copy link
Contributor

rnburn commented Nov 20, 2017

Thanks. It looks like a problem with the expected-lite library: martinmoene/expected-lite#15.

@isaachier
Copy link
Contributor Author

I agree thanks for opening the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants