If the library gets compiled with HAS_STRING_VIEW=1, consumers always need to link to the functions using std::string_view, as they are the only ones compiled into the shared library.
If the library gets compiled with e.g. C++17 and the user uses an older standard version they'll still get an error, but an helpful compile-time one suggesting to enable C++17 mode, instead of a cryptic linking error.
If the library gets compiled with
HAS_STRING_VIEW=1
, consumers always need to link to the functions usingstd::string_view
, as they are the only ones compiled into the shared library.If the library gets compiled with e.g. C++17 and the user uses an older standard version they'll still get an error, but an helpful compile-time one suggesting to enable C++17 mode, instead of a cryptic linking error.
You can find a longer explanation here: https://github.com/HowardHinnant/date/pull/754#issuecomment-1361248007