Kann ich eine öffentliche Methode definieren, ohne sie in den Kopfball zu erklären?
Posted: 22 May 2025, 11:40
Ich habe eine Klasse, die als API für meine Bibliothek verwendet wird. Die Methode sollte nicht aus Sicherheitsgründen, sondern aus praktischen Gründen versteckt sein. < /P>
// myclass.hpp
class MyClass(
);
< /code>
// myclass_hidden.hpp
void MyClass::specialmethod();
< /code>
Then I don't provide the myclass_hidden.hpp, it's just added for adding public methods only used by the users with the header file, keeping the API/ABI.
// myclass.hpp
class MyClass(
);
< /code>
// myclass_hidden.hpp
void MyClass::specialmethod();
< /code>
Then I don't provide the myclass_hidden.hpp, it's just added for adding public methods only used by the users with the header file, keeping the API/ABI.