Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove ambiguous operator #527

Merged

Conversation

trittsv
Copy link
Contributor

@trittsv trittsv commented Feb 11, 2025

This PR removes a ambiguous operator.

It solves the following situation.

dds::core::InstanceHandle handle = domainParticipant.instance_handle();
std::ostringstream s;
s << handle;

Error:

error C2593: 'operator <<' is ambiguous 
D:\conan\short\f72057\1\include\ddscxx\dds/core/detail/TInstanceHandleImpl.hpp(105,22): message : could be 'std::ostream &operator <<( 
std::ostream &,const dds::core::TInstanceHandle<org::eclipse::cyclonedds::core::InstanceHandleDelegate> &)' [found using argument-depe 
ndent lookup]
D:\conan\short\f72057\1\include\ddscxx\dds/core/detail/TInstanceHandleImpl.hpp(112,22): message : or       'std::ostream &operator <<( 
std::ostream &,const dds::core::TInstanceHandle<org::eclipse::cyclonedds::core::InstanceHandleDelegate>)' [found using argument-depend 
ent lookup]
 message : while trying to match the argument list '(std::ostringstream, dds::core::InstanceHandle)'

@eboasson
Copy link
Contributor

I wonder the vague (to me) errors in https://dev.azure.com/eclipse-cyclonedds/cyclonedds-cxx/_build/results?buildId=6872&view=logs&jobId=1600059a-7091-5d41-ccb9-416f6972ece0&j=1600059a-7091-5d41-ccb9-416f6972ece0&t=7ad8b019-d95f-5e19-9aeb-cd9e72c6a999 are caused by this. A quick scan of the log doesn't show it complaining about instance handles, but perhaps that is behind another layer of unwrapping?

If it is just the test code that suffers from this, then let's fix the test code :)

@eboasson
Copy link
Contributor

@trittsv that failure seems to have something to do with an interaction between gtest and old gcc. I have no idea what/why/how/..., but it builds fine with this commit on top of yours: eboasson@ee6d57b

What do you think?

@trittsv
Copy link
Contributor Author

trittsv commented Feb 13, 2025

@eboasson i like this solution, i will integrate it into this PR. May its a bug in the compiler, buts thats just a wild guess.

@eboasson eboasson merged commit 80b4dc0 into eclipse-cyclonedds:master Feb 14, 2025
20 checks passed
@trittsv trittsv deleted the bugfix/remove-ambiguous-operator branch February 14, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants