ddiakopoulos / tinyply

:earth_africa: C++11 ply 3d mesh format importer & exporter
598 stars 118 forks source link

Provide homonimous const acessor for Buffer::get #44

Closed SergioRAgostinho closed 1 year ago

SergioRAgostinho commented 4 years ago

In this PR I'm proposing to create a const qualified get for Buffer and remove the explicitly named get_const method. It's unconventional to provide a const version of the same method with a different name. This way, your users just need to call buffer.get(), and the correct version will be used depending on whether buffer is const or not.

I also had to rename FALSE to false in the unit tests, as FALSE is not defined by gcc.

Edit: I'm suggesting changes to the public API because I believe these have not been released yet.

PieroV commented 3 years ago

Yes please, merge this PR! :pray: Or at least keep both the methods/add const to the get_const, otherwise const-correctness of get_const is broken. Thanks!

nigels-com commented 2 years ago

Looks good to me. :smile:

ddiakopoulos commented 1 year ago

Addressed in #64 - Thanks for your PR! I just didn't have time to look at these until recently.