mixed type initializer lists make life hard
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 248
- Forks
- 72
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 15
Description
```
Node n;
n.set({ 42, 3.1415});
```
Yields:
```
n.set({ 42, 3.1415});
~~^~~
/Users/harrison37/Work/github/llnl/conduit/src/libs/conduit/conduit_node.hpp:548:10: note: candidate function
void set(const std::initializer_list &data);
^
/Users/harrison37/Work/github/llnl/conduit/src/libs/conduit/conduit_node.hpp:552:10: note: candidate function
void set(const std::initializer_list &data);
^
/Users/harrison37/Work/github/llnl/conduit/src/libs/conduit/conduit_node.hpp:556:10: note: candidate function
void set(const std::initializer_list &data);
^
/Users/harrison37/Work/github/llnl/conduit/src/libs/conduit/conduit_node.hpp:560:10: note: candidate function
```
We would want to promote the int to a float in this case (as we do for yaml and json parsing)
Not sure what level of C++ wizardry we will need to figure out how to make that happen.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/libs/conduit/conduit_node.hpp around the initializer-list set overloads cited in the compiler output, and reproduce Node n; n.set({42, 3.1415}). Determine how mixed numeric types are handled by the existing overloads. Done means the integer is promoted to float for this call, consistently with the stated YAML and JSON parsing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100