dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.61k stars 114 forks source link

remove Plane map from NCPP #1983

Open dankamongmen opened 3 years ago

dankamongmen commented 3 years ago

We're getting linkage failures on Windows originating in Plane.cc. Looking at this file, I don't understand the point of this map<Plane> we're carrying around inside NCPP. The wrappers oughtn't need to have any such map of planes; they're all accessible via Notcurses C API functions. I think this might be tied to #1474/#645, though I'm not certain of that. Definitely there seems to be a bit more weight in the C++ wrappers than I would imagine to be correct. Let's see if we can't pull on this thread without unraveling the entire thing.

@grendello , any comments on this?

dankamongmen commented 3 years ago

oh i think i see what's going on here. you have ncpp::Plane and ncplane*, with the former always holding one of the latter. when you call a function that returns a Plane by way of wrapping a return value of an ncplane*, you don't want to return an entirely new one. that makes sense. is it necessary, though? so long as that's a very lightweight Plane wrapper, and it has no local logic, the only downside i can see is that you can't compare two Planes for equality directly. but that's why operator overloading exists, right?