Commit Graph

36 Commits

Author SHA1 Message Date
Bananymous 921d95d18f All: Clear lines with only whitspace in them 2023-09-10 00:31:42 +03:00
Bananymous efb3271588 BAN: Fix function call in Vector 2023-06-01 00:50:04 +03:00
Bananymous cfa025acae BAN: Move RefPtr to its own file and create New.h
New.h contains definitions for placement new operators and
BAN::allocator and BAN::dealloctor
2023-04-10 21:07:25 +03:00
Bananymous e5c3486826 BAN: Vector now takes optional argument for default value on resize 2023-03-28 23:10:36 +03:00
Bananymous ce3f268075 BAN: Implement basic Span
This is wrapper over contiguous block of memory e.g. Vector
2023-03-20 13:34:26 +02:00
Bananymous 8edabaea55 BAN: Add iterators to all containers with contiguous memory 2023-03-20 13:26:42 +02:00
Bananymous 371dfe8ef3 BAN: Formatter now uses perfect forwarding on its arguments 2023-03-08 21:31:26 +02:00
Bananymous 52aa98ba25 Kernel+LibC: Add some errno codes
Kernel now returns ENOMEM and other errnos, so we dont have to write
error messages
2023-03-02 21:10:44 +02:00
Bananymous 4afc4660a4 BAN: Basic containers have shrink_to_fit() method
I also chaged the default memory allocation increase from 1.5 to 2
2023-02-22 02:07:05 +02:00
Bananymous 247f03c79e BAN: Make ErrorOr<> have attribute [[nodiscard]]
We don't have to specify it everytime we make function return ErrorOr
2023-02-19 20:10:30 +02:00
Bananymous 7f12a7050a BAN: Add data() to Vector.
This allows you to access the underlying data in a vector
2023-02-16 20:47:49 +02:00
Bananymous 4f8fcf0bd7 BAN: Add Formatter specialization for Vector 2023-02-10 02:58:14 +02:00
Bananymous 7ee4ecd7f4 BAN: Vector's and Queue's underlying type is T* instead of uint8_t*
I have no idea what kind of brainfart I had to make use uint8_t*
that just complicated the code :D
2023-02-10 00:12:23 +02:00
Bananymous e5ffc1686f BAN: Vector::const_iterator now uses const T* as underlying type 2023-02-09 23:06:49 +02:00
Bananymous 338771c5b0 BAN: Cleanup Vector code
*Applies to last patch also!*

Remove duplicate code in iterators. We used to have separate iterator
and const_iterator but now they are the same class with some enable_if
magic to disable references from const_iterator

This introduces some 'bad things' you can for example call
const_iterator.operator*<false>() to obtain non const reference. I
don't think this matters since you could use const_cast or something
else to work around const if you really tried
2023-02-07 11:08:05 +02:00
Bananymous 0d2d6e5348 BAN: Fix all emplace functions to actually do perfect forwarding 2023-02-01 21:41:51 +02:00
Bananymous 9b8de5025a All: rename every function from UpperCamelCase to snake_case
This was a mess since I didn't know which to use but now I decided
to go with snake_case :)
2023-02-01 21:05:44 +02:00
Bananymous 64f0cc0d42 BAN: fix Vector code
one return value was missing and AddressOf functions were kinda ugly
2023-01-18 17:18:54 +02:00
Bananymous 1340e26148 BAN: Add Vector::Emplace and EmplaceBack() and fix insert assignment 2023-01-17 11:59:36 +02:00
Bananymous cf63552b2a BAN: Cleanup includes 2023-01-17 11:38:16 +02:00
Bananymous a02d4c59ed BAN: Vector and Queue replace Address() with AddressOf and correct const 2023-01-16 12:10:16 +02:00
Bananymous c62d512d68 BAN: Add Iterator and ConstIterator to Vector 2023-01-13 17:48:19 +02:00
Bananymous 0f4e95acc5 BAN: Rewrite vector with move semantics 2023-01-13 15:04:06 +02:00
Bananymous 61de71e0d5 BAN: Properly allocate/deallocate elements in Vector/Queue 2023-01-13 01:09:40 +02:00
Bananymous 6ed542d6bf BAN: Queue and Vector now default initialize newly allocated elements 2023-01-13 01:00:50 +02:00
Bananymous c33c6c5785 BAN: memcpy only if we already have a buffer 2023-01-13 00:17:19 +02:00
Bananymous 61bd9da8e0 BAN: Add [[nodiscard]] to BAN functions returning ErrorOr 2023-01-12 23:57:07 +02:00
Bananymous 78da037dda BAN: String, Queue and Vector dont use floating point arithmetic 2023-01-12 17:00:29 +02:00
Bananymous 6f9552d673 BAN: Add math to its own namespace 2023-01-10 19:11:27 +02:00
Bananymous 1a65ea977d BAN: Better ASSERT() 2023-01-10 17:43:18 +02:00
Bananymous b60af90538 BAN: Add min, max and clamp 2022-12-30 19:52:16 +02:00
Bananymous 7ae00ac76e BAN: Vector now has a Has() function 2022-12-20 11:38:29 +02:00
Bananymous 9fa3d891e9 BAN: Vector now has a copy constructor 2022-12-15 17:28:12 +02:00
Bananymous 57b5e7ecf3 BAN: Add pragma once to String and Vector 2022-12-13 15:15:36 +02:00
Bananymous b42469efd7 BAN: Vector now has Back() and Front() helpers 2022-12-13 15:08:12 +02:00
Bananymous 07f61d9b82 BAN: Implement basic vector 2022-12-13 14:43:58 +02:00