I just noticed that using std::string_view is not very convenient when working with liblo's C++ wrapper as it contains its own string_type which has no support for std::string_view. One needs to pass std::string_view::data() instead of the actual std::string_view to any function requiring a string_type.
The best option might be to replace string_type with std::string_view altogether, but this might introduce either the need to disable support for C++14 and below or to introduce an interface to string_type which is similar to std::string_view. The latter option might be better as the required interface needed seems to be only ::data() returning a const char*. In that case, it should be sufficient to check for the C++ version and use either using string_type = std::string_view or the own implementation.
The final option, which is probably the easiest to implement, but (in my opinion) the worst of the all, is to just accept std::string_view as parameter in string_type's constructor. This is, however, kinda like reinventing the wheel as std::string_view and string_type kind of do the same.
I might find some time implementing this myself and providing a PR, but in the meantime, feel free to add your opinion to this. If this is not a wanted enhancement, please let me know.
I just noticed that using
std::string_viewis not very convenient when working with liblo's C++ wrapper as it contains its ownstring_typewhich has no support forstd::string_view. One needs to passstd::string_view::data()instead of the actualstd::string_viewto any function requiring astring_type.The best option might be to replace
string_typewithstd::string_viewaltogether, but this might introduce either the need to disable support for C++14 and below or to introduce an interface tostring_typewhich is similar tostd::string_view. The latter option might be better as the required interface needed seems to be only::data()returning aconst char*. In that case, it should be sufficient to check for the C++ version and use eitherusing string_type = std::string_viewor the own implementation.The final option, which is probably the easiest to implement, but (in my opinion) the worst of the all, is to just accept
std::string_viewas parameter instring_type's constructor. This is, however, kinda like reinventing the wheel asstd::string_viewandstring_typekind of do the same.I might find some time implementing this myself and providing a PR, but in the meantime, feel free to add your opinion to this. If this is not a wanted enhancement, please let me know.