From f3479772985f9f6a336e8abac638ff180697ba9b Mon Sep 17 00:00:00 2001 From: River <26424577+wusatosi@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:42:52 -0500 Subject: [PATCH 1/4] draft readme --- README.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f140fbf..0f61c87 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,79 @@ -# beman.inplace\_vector: A dynamically-resizable vector with fixed capacity and embedded storage +# beman.inplace\_vector + +A dynamically-resizable vector with fixed capacity and embedded storage + +This repository implements `std::inplace_vector` extension targeting C++26. +The `beman.inplace\_vector` library aims to evaluate the stability, +the usability, and the performance of these proposed changes before they +are officially adopted by WG21 into the C++ Working Draft. +Additionally, it allows developers to use these new features before they +are implemented in major standard library compilers. + +## Implements + +- [`inplace\_vector` P0843R14](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) + +## Usage + +> `inplace\_vector`, is a dynamically-resizable array with capacity fixed +at compile time and contiguous inplace storage, +that is, the array elements are stored within the vector object itself. +Its API closely resembles `std::vector`, +making it easy to teach and learn, +and the inplace storage guarantee makes it useful in environments in +which dynamic memory allocations are undesired. + +```cpp +// TODO: Add example +``` + +## How to Build + +### Compiler support + +Building this repository requires **C++20** or later. + +### Dependencies + +TODO: tested platforms. + +### Instructions + + + +#### Manual CMake Build + +``` +# Configure build +$ cmake -S . -B build -DCMAKE_CXX_STANDARD=20 +-- The CXX compiler identification is GNU 11.4.0 +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working CXX compiler: /usr/bin/c++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- Configuring done (0.4s) +-- Generating done (0.0s) +-- Build files have been written to: /.../inplace_vector/build + +# Build +$ cmake --build build +[ 50%] Building CXX object src/beman/inplace_vector/tests/CMakeFiles/beman.inplace_vector.test.dir/inplace_vector.test.cpp.o +[100%] Linking CXX executable beman.inplace_vector.test +[100%] Built target beman.inplace_vector.test + +# Run tests +$ ctest --test-dir build/ +Internal ctest changing into directory: /.../inplace_vector/build +Test project /.../inplace_vector/build + Start 1: beman.inplace_vector.test +1/1 Test #1: beman.inplace_vector.test ........ Passed 0.00 sec + +100% tests passed, 0 tests failed out of 1 + +Total Test time (real) = 0.01 sec +``` + + # beman.inplace\_vector A dynamically-resizable vector with fixed capacity and embedded storage @@ -15,7 +19,9 @@ are implemented in major standard library compilers. ## Usage -> `inplace_vector`, is a dynamically-resizable array with capacity fixed +### Definition in P0843 + +> `inplace_vector` is a dynamically-resizable array with capacity fixed at compile time and contiguous inplace storage, that is, the array elements are stored within the vector object itself. Its API closely resembles `std::vector`, @@ -23,6 +29,8 @@ making it easy to teach and learn, and the inplace storage guarantee makes it useful in environments in which dynamic memory allocations are undesired. +### Code example + ```cpp // TODO: Add example ``` @@ -74,7 +82,3 @@ Test project /.../inplace_vector/build Total Test time (real) = 0.01 sec ``` - - From b48aacd8b79c7a7a390e7aabe721cf6781518101 Mon Sep 17 00:00:00 2001 From: River <26424577+wusatosi@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:05:37 -0500 Subject: [PATCH 4/4] Update README.md Co-authored-by: David Sankel --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 209226d..d68a039 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,6 @@ SPDX-License-Identifier: A dynamically-resizable vector with fixed capacity and embedded storage -This repository implements `std::inplace_vector` extension targeting C++26. -The `beman.inplace_vector` library aims to evaluate the stability, -the usability, and the performance of these proposed changes before they -are officially adopted by WG21 into the C++ Working Draft. -Additionally, it allows developers to use these new features before they -are implemented in major standard library compilers. - ## Implements - [`inplace_vector` P0843R14](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html)