Commit graph

110 commits

Author SHA1 Message Date
4d904ac689 Fix deprecation warning
Also put iterator into dhandy namespace. I don't
remember why I left it out, and it's probably a
sign I should have not done so.
2024-04-26 00:19:50 +02:00
d3092f9359 Update catch ref to 3.5.4
Fix noob mistake in previous commit
2024-04-25 23:48:40 +02:00
cd85666005 Fix build of unit tests 2024-04-19 23:18:26 +02:00
fc5f917970 Update copyright year 2024-03-27 15:56:33 +01:00
180c338901 Just leave 'cpp' in there
It seems to be required now, but also '' is not
a valid language and the whole get_option() thing
is not working when duckhandy is a submodule.
2024-02-15 23:14:45 +01:00
100b1d557e Remove Catch2 submodule, use meson wrap
Catch2 seems to be Meson-ready now so
removing custom meson file too
2024-02-15 22:43:14 +01:00
df2f614642 Build fix on newer Meson versions 2024-02-15 22:07:05 +01:00
f04eb9f5d3 Forgot this 2022-06-07 16:51:37 +02:00
82b5200857 Add meson build scripts 2022-06-07 16:43:26 +02:00
9919f1aeb2 Use std::to_string when doing ascii conversions
It's fast, it works, it's correct. No need for
any of the fancy stuff when all we want is int
to ascii string.

Currently on my system the implementation of
std::to_string is *very* similar to mine, but
it doesn't have the overhead of calculating
ASCII offsets because their lookup already
contains ASCII values.
2021-06-07 23:10:35 +02:00
e1599820b4 Revert "Trying with a smaller lookup, still slower than std::to_string"
This reverts commit 18cdd4d9b5.
2021-06-07 22:13:50 +02:00
18cdd4d9b5 Trying with a smaller lookup, still slower than std::to_string 2021-06-07 22:12:58 +02:00
180f79fae9 Replace std::array with C array 2021-06-07 21:54:46 +02:00
c9b2d36491 Pull lookup out.
This makes the function run faster
2021-06-07 21:52:33 +02:00
a171faa95d Revert lookup removal, but keep the speed test cpp
This reverts commit 4f1c0f8d6df21d7c3b404d41512bba0b60ba7689.
2021-06-07 20:21:44 +02:00
a68815b3cd Same conversion but without any lookup 2021-06-07 20:21:32 +02:00
e3140a3add Trying with a smaller lookup, still slower than std::to_string 2021-06-07 20:20:35 +02:00
9dbabcb5c4 Working on optimisation but I'm still losing to std::to_string() 2021-05-29 22:52:30 +02:00
420257f578 Use parameter instead of assuming 10 numeric digits 2021-05-29 17:07:55 +02:00
199db7640e Add support for int_conv<std::array>() 2021-05-29 16:47:48 +02:00
938c8fa9a4 Make code a bit more readable
Changed so that int_conv<string_view>() called on a
non-constexpr doesn't compiler anymore (because code
would try to go through a consteval method). It
wouldn't work anyways as the returned value would be
always garbage. If you want a string_view then you
must either give a constexpr input value or you must
call int_conv_raw and call to_string_view() yourself.
This is better than throwing a runtime exception (which
was working ok btw).

All the SafeRetVal stuff is not needed anymore.

Also no need for all that confusing sfinae, I can just
use a bool FromInt and specialise on that.
2021-05-29 16:44:06 +02:00
a675624cab Add case sensitivity support to sse conversion 2021-05-29 12:01:01 +02:00
094f7fc679 Rename HashType to TigerHash 2021-05-29 00:57:24 +02:00
e8467cebe0 Remove custom lengthof()
duckhandy has an implementation already
2021-05-29 00:56:39 +02:00
d068e68e75 Replace with consteval
It doesn't makes any sense to use this implementation
at runtime.
2021-05-29 00:52:13 +02:00
327d93a6a4 Fix namespaces, copyright and magic numbers 2021-05-29 00:52:13 +02:00
d3731253e4 Import build time tiger hasd from doorkeeper 2021-05-29 00:34:39 +02:00
db554b8b85 Update Catch2 to latest v2.x branch 2021-05-28 02:54:18 +02:00
1ec0e143fd Replace string with basic_string<T> 2021-05-28 02:48:49 +02:00
d0e7ca0bee Merge functions 2021-05-28 02:48:07 +02:00
9539b5430f Some small code improvements 2021-05-28 02:41:41 +02:00
562eba5f68 Delete sequence_bt.hpp
This stuff has been in the standard lib
for a long time now.
2021-05-28 02:40:19 +02:00
422b475ce3 Add support for constexpr string_view creation 2021-05-28 02:06:28 +02:00
e62da38cf9 Cleaning up and simplifying code a bit 2021-05-28 02:03:52 +02:00
7f8f092372 Fix wrong variable name 2021-05-28 01:44:49 +02:00
29f6a56fc8 Some cleaning 2021-05-28 01:44:28 +02:00
eedad0d82c Move Version to bt namespace 2021-04-22 14:10:28 +02:00
5ccf4dde55 Update Catch2 to latest v2.x branch 2021-04-22 14:08:13 +02:00
5db217c978 Update copyright to 2021 2021-04-22 14:07:53 +02:00
710cdf9f04 Allow string_view conv when it's safe
You can still force a string_view conv even when it's
not safe to do so if you only intend to use the
return value during its lifetime validity. Call
int_conv_temporary() in that case.
2021-04-22 13:59:51 +02:00
b52343014b int_conv can be constexpr sometimes 2021-04-22 13:57:57 +02:00
1f44e74465 Test if conversion is using the sse when possible 2021-04-22 13:44:49 +02:00
13bd166827 Rename Count to lowercase, make const 2021-04-22 13:37:02 +02:00
3124548314 Implement Version class 2021-04-22 13:34:05 +02:00
da136cd52f Build fix in unit test 2021-04-22 13:14:10 +02:00
93d2ad6bd0 Make ary_to_int() constexpr 2021-04-22 13:02:51 +02:00
3343b51a39 Simplify code 2021-04-22 03:09:31 +02:00
40bae9c49d Build fix for clang 2021-04-22 02:59:51 +02:00
1c6de14cd4 Add test for upper case conversions and fix as necessary 2020-08-14 00:30:22 +01:00
f1d6ac789e Indentation 2020-08-14 00:04:05 +01:00