epezent / epezent/implot

`ImPlot::PlotLineG` forces data to be mutable

Open
#493 2 comments 0 reactions 0 assignees View on GitHub
type:feat
Dominant language
C++
Stars
6.2k
Forks
693
PR merge metrics
No merged PRs in 30d

Description

https://github.com/epezent/implot/blob/cc5e1daa5c7f2335a9460ae79c829011dc5cef2d/implot.h#L856

The signature for `ImPlot::PlotLineG` uses a `void*` which implies that the data it is reading is mutable. This means you cannot use something like a `const std::vector` and call `.data()` to get a pointer to the first element since a `const double*` is not implicitly convertible to a `void*`. I'd like this to be changed to a `const void*` which implies a slight change to the signature of `ImPlotGetter` to reflect this extra `const`.

This would not be an API break except for those who are using `PlotLineG` to mutate data while ImPlot is reading it.

If accepted, I'm willing to help implement this. There are other APIs that behave similarly that ought to receive this same treatment so the PR would touch more interfaces than simply `PlotLineG`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.