Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaumon authored Dec 29, 2024
1 parent 530a489 commit 2c4be0e
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Bedrock 🪨

Bedrock is an STL alternative. Smaller, simpler, in many case faster. It's meant to be **comfy** (it's a bed) for **me** (made of rock, maybe not to everyone's taste).
Bedrock is a C++20 STL alternative. Smaller, simpler, in many case faster. It's a hobby project, don't expect much more than an interesting implementation reference for things.

Currently Windows only. Supports MSVC and Clang.
Currently Windows only. Supports MSVC and Clang. There are no concrete plans to support more platforms/compilers at this time.

## Containers and Views

```c++
Vector<int> // Roughly equivalent to std::vector<int>, with extra useful methods (Find, SwapErase, etc.)
Expand All @@ -11,11 +13,39 @@ String // Roughly equivalent to std::string
StringView // Roughly equivalent to std::string_view
HashMap<int, int> // Dense open addressed (Robin Hood) hash map. Key-value pairs are stored contiguously.
HashSet<int> // Same as HashMap, but without values.
```

## Allocators

```c++
// All containers also come in different allocator flavors.
TempVector<int> // Allocates from a thread local arena. Falls back to the heap if it runs out.
FixedVector<int> // Allocates from a fixed-size arena embedded in the container.
VMemVector<int> // Allocates from a virtual memory arena embedded in the container. Can grow while keeping a stable address.
ArenaVector<int> // Allocates from an externally provided arena.

```

## Tests

Write tests anywhere:

```c++
REGISTER_TEST("Span")
{
int values[] = { 1, 2, 3, 4, 5 };
Span test = values;

Span first_two = test.First(2);
TEST_TRUE(first_two.Size() == 2);
TEST_TRUE(first_two[0] == 1);
TEST_TRUE(first_two[1] == 2);
};
```
The run them with `gRunAllTests()`.
## Other
Mutex, Atomic, Thread, Semaphore.
Function, many Type Traits, a few Algorithms...

0 comments on commit 2c4be0e

Please sign in to comment.