eclipse-iceoryx / eclipse-iceoryx/iceoryx

Issue in iox::cxx::optional class

Open
#1,854 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
2.2k
Forks
492
Avg merge
18h 57m
Merged PRs (30d)
1

Description

## Required information

**Operating system:**
E.g. Ubuntu 18.04 LTS

**Compiler version:**
E.g. GCC 7.4.0

**Observed result or behaviour:**
![image](https://user-images.githubusercontent.com/114241016/214315710-f1975cfd-afc1-4768-8fc9-4d0a811b1b94.png)

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(static_cast(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](https://user-images.githubusercontent.com/114241016/214315731-805c3f15-a4b6-45ae-8d80-dca359217e25.png)

Contributor guide

Open the contributing guide

Research direction

Start with the iox::cxx::optional implementation around line 269, using the code and build error shown in the issue to reproduce the failure. Compare the const template-argument case with std::optional; done means the reported code compiles without the const void* to void* conversion error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.