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

Compile Error: InstanceHandle has ambiguous operator #469

Open
trittsv opened this issue Feb 1, 2024 · 0 comments
Open

Compile Error: InstanceHandle has ambiguous operator #469

trittsv opened this issue Feb 1, 2024 · 0 comments

Comments

@trittsv
Copy link
Contributor

trittsv commented Feb 1, 2024

Hi,

i am trying to compile the current master 2024-02-01 but end up in a compile error.
Using: CycloneDDS: 1c9bc19, CycloneDDS-CXX: e41e5c8

Code (my.cpp, with cyclone 0.10.4 this works, but not master):

dds::core::InstanceHandle handle = myDomainParticipant.instance_handle();
std::ostringstream s;
s << handle; // Compile Error
std::string m_sessionId = s.str();

With:

[2024-02-01T10:08:41.754Z] my.cpp(73,16): error C2593: 'operator <<' is ambiguous 
[2024-02-01T10:08:41.754Z] C:\cnn0\ea4174\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-dependent lookup]
[2024-02-01T10:08:41.754Z] C:\cnn0\ea4174\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-dependent lookup]
[2024-02-01T10:08:41.754Z] C:\cnn0\c86a9f\1\src\ddkit\ddcltsvc\SessionReal.cpp(73,16): message : while trying to match the argument list '(std::ostringstream, dds::core::InstanceHandle)'

Building with visual studio 2019.

Why does a InstanceHandle have two ostream operators in Cyclonedds?
(When i remove the one marked with "workaround" then it works)

https://github.com/eclipse-cyclonedds/cyclonedds-cxx/blob/e41e5c87192423e3443b68ebed064f4debdcbea6/src/ddscxx/include/dds/core/detail/TInstanceHandleImpl.hpp#L105C1-L105C3

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

No branches or pull requests

1 participant