optional icon indicating copy to clipboard operation
optional copied to clipboard

Removing direct value access

Open juxeii opened this issue 5 years ago • 2 comments

Hi, I wonder what would be the fastest way on removing the error-prone * and -> operators for direct value access? Towards a more monadic implementation I do not want the users accessing these public and unsafe operators. Would it make sense to declare all the non-class templates as friends to the optional class? I'm not an expert in library design and your implementation is way beyond my abilities...

Thx Juergen

juxeii avatar Jun 11 '19 12:06 juxeii

Probably easiest to remove those functions from the source and run the tests to find any places they were called, then replacing those sites with direct accesses by making the non-members friend functions like you say.

TartanLlama avatar Jun 25 '19 10:06 TartanLlama

For now I go with a subtype approach and see if I can delete the unsafe operations.

juxeii avatar Jun 25 '19 10:06 juxeii