mockingbirdnest / Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program
MIT License
769 stars 69 forks source link

Ambiguous pointers #157

Open eggrobin opened 10 years ago

eggrobin commented 10 years ago
Low-priority thoughts on alternatives to the polysemic T*.

As discussed, C-style pointers T* (and C++ references T&) have many possible meanings which are not explicit. Moreover, cdecl code forces us to occasionally use C-style pointers as they would be used in C (including for ownership and ownership transfer, optional parameters, etc.), so assigning a single (non-owning) semantic to C-style pointers is bound to fail.

Some current uses of C-style pointers, with replacement proposals:

Parameters
eggrobin commented 9 years ago

Non-null pointers have been addressed by #241.