Commit Graph

218 Commits

Author SHA1 Message Date
Bananymous d054e5b4b7 BAN: Implement basic radix sort for unsigned integers 2024-02-01 15:22:28 +02:00
Bananymous c4bf1641bd BAN: Add cool API for LinkedList
You can now move elements between LinkedLists without allocations or
deallocations. Same node moves from source to destination
2024-02-01 14:19:02 +02:00
Bananymous 4273f43be1 BAN: Move placement new to its own file and fix includes 2024-01-31 23:55:41 +02:00
Bananymous cc79f55817 BAN: Add compare_exchange to atomic 2024-01-30 01:21:15 +02:00
Bananymous 0408aa9bbc BAN: Implement is_unsigned* traits and (un)?signed_integral concepts 2024-01-25 14:17:23 +02:00
Bananymous dfe5a2d665 All: Cleanup all files
Add newline to end of files and remove whitespace from end of lines
2024-01-24 15:53:38 +02:00
Bananymous d2cf7c7a5c BAN: Implement basic Atomic class that wraps gcc builtins 2024-01-24 14:30:04 +02:00
Bananymous de4fdcd898 BAN: Implement is_base_of and integral_constant to Traits 2024-01-22 16:59:14 +02:00
Bananymous d2bc399770 BAN: Make StringView::split const and fix bug with empties 2024-01-03 00:14:29 +02:00
Bananymous 07d5d3f936 BAN: Simple iterator now contains valid flag
This allows iteration over empty containers
2023-12-29 14:49:57 +02:00
Bananymous 861bf27e96 BAN: Implement abs() 2023-12-26 00:54:06 +02:00
Bananymous b833239a82 BAN: Make hashmap work with non-copy constructable values 2023-12-24 13:38:47 +02:00
Bananymous 6fec142760 BAN: Add requires clauses for vector 2023-12-24 13:38:20 +02:00
Bananymous 84b2438b3d BAN: Add requires for copy constructor for linked list 2023-12-24 13:37:49 +02:00
Bananymous 0e714d5eb4 BAN: Implement String::operator==(const String&) 2023-12-24 13:36:46 +02:00
Bananymous 9b8e6e6629 BAN: Implement is_*constructable 2023-12-24 13:36:12 +02:00
Bananymous 2e77718f07 BAN: Implement find() for StringView 2023-12-23 18:43:52 +02:00
Bananymous f371fabe35 BAN: HashSet is now internally Vector<LinkedList<T>>
It used to be Vector<Vector<T>> but this feels more proper
2023-12-23 16:37:21 +02:00
Bananymous 79a15132da BAN: Cleanup HashSet
I now use BAN::Iterator as the base iterator. Also unstable version
was added.
2023-12-23 16:32:06 +02:00
Bananymous bacc0db778 BAN: Fix unstable hash map rebucket 2023-12-23 16:31:42 +02:00
Bananymous 3963afe343 BAN: Add unstable version of hash map
This version differs only when doing rebucket. If rebucket fails,
the whole hash map is invalidated. This allows rebucketing to use
moving instead of copying.
2023-12-19 22:23:28 +02:00
Bananymous 951873098e BAN: Rewrite heap sort
Heap sort is now more close to gnulibc++ version. This is just more
simplified version.
2023-12-08 22:45:55 +02:00
Bananymous 2b927b9729 BAN: Restructure sort functions and namespaces 2023-12-08 18:58:47 +02:00
Bananymous be657b9b18 BAN: Add default sort. This is wrapper around sort_intro 2023-12-08 00:10:09 +02:00
Bananymous 94e6b9fa65 BAN: Implement intro sort 2023-12-07 23:56:11 +02:00
Bananymous d8ea0eeba3 BAN: Add less than operator for iterator 2023-12-07 23:55:41 +02:00
Bananymous 6873244169 BAN: Move placement new to New.h
I have no idea why they were defined in Move.h
2023-12-07 23:52:57 +02:00
Bananymous 805b4096e9 BAN: Remove empty else. Builds with -Wall -Wextra 2023-12-07 23:50:35 +02:00
Bananymous 0f74e123b8 BAN: Implement ilog2 for unsigned integers 2023-12-07 23:50:04 +02:00
Bananymous 7f212106db BAN: Implement heap sort 2023-12-07 23:18:49 +02:00
Bananymous 46c3da71b6 BAN: Cleanup sorting code 2023-12-07 23:18:49 +02:00
Bananymous e5cab047d6 BAN: Implement more methods for iterators 2023-12-07 23:18:49 +02:00
Bananymous bf3e9eabd5 BAN: Implement distance() for iterators 2023-12-07 23:18:49 +02:00
Bananymous 19604015de BAN: Implement quick sort 2023-12-07 19:28:31 +02:00
Bananymous 08bc0a2815 BAN: Implement next() and prev() for iterators and use them in sorts 2023-12-07 19:28:05 +02:00
Bananymous 6caa9b6f95 BAN: implement quick sort and test for it 2023-12-07 11:55:28 +02:00
Bananymous 59ad639fa8 BAN: Fix simple iterator operator--() 2023-12-07 11:55:28 +02:00
Bananymous 43458cc74f BAN: implement exchange sort and test for it 2023-12-07 11:55:28 +02:00
Bananymous e935a33a4d BAN: add value_type to iterators 2023-12-07 10:15:18 +02:00
Bananymous a872efdef2 BAN: implement basic swap
This will be improved, currently just works on general type T and
moves values between arguments.
2023-12-07 09:26:17 +02:00
Bananymous 19ed0cb9bf BAN: Add basic GUID data structure 2023-11-21 15:11:50 +02:00
Bananymous 240d57f4b4 BAN: Update bytespan -> span API 2023-11-04 18:12:46 +02:00
Bananymous ca34ece8ef BAN: Update ASSERT api
its now much harder to mix < with <= and > with >=
2023-11-02 00:01:12 +02:00
Bananymous 3c311efb81 BAN: Implement better ASSERT macros
Implement macros for all basic binary ops. These macros print failed
values when the fail.
2023-10-30 16:22:02 +02:00
Bananymous d5e0900cbb BAN: String now uses union for its sso storage
This allows String to shrink by 8 bytes since Variant's 8 index is
no longer stored in here.

This required me to make Strings max size one bit less, but that
should still be fine. There should never be strings with size of
over half of the computer's address space.
2023-10-30 11:13:16 +02:00
Bananymous 229082a1b2 BAN: Rewrite String with small string optimizations
String now holds a 15 byte sso buffer. I'm not sure what the size
should actually be but 15 will work for now. Maybe the sso buffer
should be contained in an union with one bit flag in size instead of
variant that uses extra 8 bytes for type index.

This patch buffs sizeof(String) from 24 bytes to 32 bytes on 64 bit.
I assume this is much better version than the old which had to make
allocation even for empty strings :D.
2023-10-29 03:11:13 +03:00
Bananymous 0db17e9d39 BAN: Add variant to ForwardList
I should be using the forward list more
2023-10-29 02:28:55 +03:00
Bananymous d98f84f9d3 BAN: Update ByteSpan API
Add ByteSpan::as_span<T> and const versions of as() and as_span()
require T to be const.
2023-10-28 22:10:47 +03:00
Bananymous 3566ddab00 BAN: ByteSpan can be sliced without specified size
This will give span with all remaining size after offset
2023-10-25 21:41:11 +03:00
Bananymous fc8a000e46 BAN: Fix bug of size of splice after slice()
I have no idea what was I doing before :D
2023-10-24 17:23:45 +03:00