tinyply icon indicating copy to clipboard operation
tinyply copied to clipboard

Provide homonimous const acessor for Buffer::get

Open SergioRAgostinho opened this issue 5 years ago • 2 comments

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.

SergioRAgostinho avatar Jul 19 '20 14:07 SergioRAgostinho

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!

PieroV avatar Jul 24 '21 20:07 PieroV

Looks good to me. :smile:

nigels-com avatar Jan 18 '22 09:01 nigels-com

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

ddiakopoulos avatar Feb 27 '23 18:02 ddiakopoulos