martin-olivier / dylib

C++ cross-platform wrapper around dynamic loading of shared libraries (dll, so, dylib)
https://conan.io/center/recipes/dylib
MIT License
293 stars 44 forks source link

Add a named constant for not using OS decorations #51

Closed eyalroz closed 2 years ago

eyalroz commented 2 years ago

Instead of saying:

dylib lib("foo.lib", false);

I should be able to say:

dylib lib("foo.lib", dylib::no_decorations);

or

dylib lib("foo.lib", dylib::no_os_decorations);

or

dylib lib("foo.lib", dylib::use_filename_verbatim);

(whichever of these identifiers you like best.) Otherwise, the reader has to guess what false means. This breaks the Principle of Least Astonishment.

and similarly

dylib lib("foo", dylib::with_os_decorations);

if I want to.

martin-olivier commented 2 years ago

Hello Eyal, I've made your request changes on https://github.com/martin-olivier/dylib/pull/52 Feel free to review those changes