access_private icon indicating copy to clipboard operation
access_private copied to clipboard

Addressing the limitation of the class's private class

Open schaumb opened this issue 2 years ago • 5 comments

with auto return value and decltype it can leak out the private types too. see example

schaumb avatar Dec 15 '23 14:12 schaumb

(and private type private member example)

schaumb avatar Dec 15 '23 16:12 schaumb

Hey, thank you for the example. It's great that we could have a work around for this limitation. I'd like to keep C++11 compatibility, but we could detect if the given compiler has the "auto return type C++14" feature and if yes then we could define the proper macros for access_private_class. Do you think you could create a PR that addresses this?

martong avatar Dec 21 '23 10:12 martong

I created a C++20 fork from this repo. There it can made without macro. If someone has time to work with it, backport here.

schaumb avatar Jan 30 '24 22:01 schaumb

Okay, thank you. I am extending the readme to advertise your fork for C++20.

martong avatar Feb 01 '24 09:02 martong

Umm, not closing, since at some point we could backport to C++14.

martong avatar Feb 01 '24 09:02 martong