c++ - Check the license in the constructor -
i need protect c++ library writing. library has single entry point via class called foo . did is: //.hpp class foo{ public: foo(); .... } //.cpp foo::foo(){ if(check_for_lic()==result::failed){ throw no_lic_exception(); } } the class has 1 constructor. my question enough? in other words, without reverse engineering, possible developer construct foo without checking license? p.s. distribute headers , static library .lib (or .a ) if has header file, can add another, overloaded constructor foo, doesn't check license, , use that.