Nice catch: when calling with basic_bol::match(nullptr, 5, 5), the
method addresses null[4].
Turned this condition into debug assert, as (nullptr, 5, 5) is invalid
input parameter combination.
diag_file::size() was setting the m_state and returning 0 on error,
which violated original size() convention not to change stream state and
to return fsize_max on error.
Changing m_state prevented declaring size() method as const before.
cache::seek() was missing size() return value check.
Signed-off-by: Simon Rozman <simon@rozman.si>
No need to use locale-specific character type detection when ASCII.
Locale-specific implementation on Windows is not that very fast.
Signed-off-by: Simon Rozman <simon@rozman.si>
"C"-locale is basically ASCII while (Microsoft) implementation is not
quite performant to our likes. We can do faster.
Signed-off-by: Simon Rozman <simon@rozman.si>
This is analogous to string.hpp's strlen, strcpy, strcat, which use C++
polymorphism rather than function name decorations for char/wchar_t
flavors.
Signed-off-by: Simon Rozman <simon@rozman.si>
Like with stdex::locale_t, this frees us from using Windowsizms on other
platforms. Sockets came from Unix to Windows and not the other way
around in the first place.
Signed-off-by: Simon Rozman <simon@rozman.si>
Unfortunately, this requires at least C++17, but the inline is exactly
what we need to avoid redundant copies of static const data.
Signed-off-by: Simon Rozman <simon@rozman.si>
It requires libuuid-devel on Linux and since this function is optional, lets
not impose libuuid-devel dependency on anything that #include
<stdex/string.hpp>.
Signed-off-by: Simon Rozman <simon@rozman.si>
The stdex::sys_info is instantiated for each compilation unit. To reduce
amount of copies, move it to a separate .hpp as system.hpp is almost
always #included.
Breaking-change: Add #include <stdex/sys_info.hpp>
Signed-off-by: Simon Rozman <simon@rozman.si>