eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.6k stars 373 forks source link

Issue in iox::cxx::optional class #1854

Open prashantindalkar opened 1 year ago

prashantindalkar commented 1 year ago

Required information

Operating system: E.g. Ubuntu 18.04 LTS

Compiler version: E.g. GCC 7.4.0

Observed result or behaviour: image

I am getting the build error while compiling the above line. As we are no able to pass "const" as template argument.

invalid conversion from 'const void' to 'void' [-fpermissive] 269 new (static_cast<T>(static_cast<void>(m_data))) T(std::forward(args)...); ^~
const void*

Expected result or behaviour: Same code we are able to compile using std::optional.

Conditions where it occurred / Performed steps: image

elBoberido commented 1 year ago

@prashantindalkar which iceoryx version are you using? I tested it locally with master and it doesn't show the problem but we recently did a refactoring which might fixed the problem.

prashantindalkar commented 1 year ago

@elBoberido Thank you for your help. I am using 2.90.0 version of iceoryx.

I have some use cases of >= and <= operators in iox::cxx::optional.

For ex: iox::cxx::optional< int > obj1; iox::cx::optional< int > obj2; obj1>=obj2; or obj1<=obj2;

Also obj1.swap(obj2) is not supported in current implementation .

similar to above many other operators are not supported currently in iox::cxx::optional class.

Thank You for your help.

Thank You, Prashant Indalkar

elBoberido commented 1 year ago

@prashantindalkar unfortunately ubuntu 18.04 is not supported anymore and I can't reproduce your issue on ubuntu 22.04 with a newer compiler.

@elfenpiff @mossmaurice do you have any plans or objections for implementing operator>=, etc.?

elfenpiff commented 1 year ago

@prashantindalkar It seems this issue slipped my attention - sorry for that. So I have no objections to implement the operators you have mentioned. Would you like to create a pull request or would this be a feature request from your side where you would like us to provide this operators in iceoryx?