eclipse-iceoryx / eclipse-iceoryx/iceoryx

Use newtype pattern to solve parameter mixup

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

Description

## Brief feature description

One can easily mix up seconds and nanoseconds in function arguments since the underlying type is the same. This can be fixed at compile time by using the newtype pattern and create two distinct non convertable types with the same properties as before.

Extracted from: #1196

- [ ] In duration with seconds and nanoseconds
- [ ] In SharedChunk while comparing raw pointers

Contributor guide

Open the contributing guide

Research direction

Start by locating the duration code that accepts seconds and nanoseconds, then find SharedChunk comparisons involving raw pointers. Review how those arguments and comparisons are currently typed. Done means the two duration units and pointer-related values use distinct non-convertible types while retaining their existing properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.