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.
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.
Add functions to swap endiannes or convert host to big/little endian
This code should be very compiler friendly and should be optimized to
single bswap instruction on x86.
This iterator should be able to iterate any container within container
with type iterator defined.
This also fixed bug if first entry in outer container is empty container.
We now have more or less posix issue 2018 conforming libc headers.
This was a really time consuming and boring operation but it had to
be done.
Now we get to actually start implementing libc :)
It is annoying that we have to have separate macros for these but
I can't find a way to cleanly return lvalue reference from statement
expression. Currently we cast the reference to pointer and return
unreference the pointer outside of the expression.
This feature will probably not be used any time soon, but atleas
it is implemented if I need it one day
References can be assigned with the set() method. Construction nor
assigment operators cannot be used with references to avoid ambiguity
with what assignment to reference does.
You can set the underlying reference with the set() method and access
it with the get() method.
The references are stored as pointers to the object under the hood
which means that size of a reference is sizeof pointer.