@@ -6,11 +6,82 @@ SPDX-License-Identifier: <SPDX License Expression>
66
77A dynamically-resizable vector with fixed capacity and embedded storage
88
9- ## Linting
9+ ## Implements
10+
11+ - [ ` inplace_vector ` P0843R14] ( https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html )
12+
13+ ## Usage
14+
15+ ### Definition in P0843
16+
17+ > ` inplace_vector ` is a dynamically-resizable array with capacity fixed
18+ at compile time and contiguous inplace storage,
19+ that is, the array elements are stored within the vector object itself.
20+ Its API closely resembles ` std::vector<T, A> ` ,
21+ making it easy to teach and learn,
22+ and the inplace storage guarantee makes it useful in environments in
23+ which dynamic memory allocations are undesired.
24+
25+ ### Code example
26+
27+ ``` cpp
28+ // TODO: Add example
29+ ```
30+
31+ ## How to Build
32+
33+ ### Compiler support
34+
35+ Building this repository requires ** C++20** or later.
36+
37+ ### Dependencies
38+
39+ TODO: tested platforms.
40+
41+ ### Instructions
42+
43+ <!-- TODO: add preset support -->
44+
45+ #### Manual CMake Build
46+
47+ ```
48+ # Configure build
49+ $ cmake -S . -B build -DCMAKE_CXX_STANDARD=20
50+ -- The CXX compiler identification is GNU 11.4.0
51+ -- Detecting CXX compiler ABI info
52+ -- Detecting CXX compiler ABI info - done
53+ -- Check for working CXX compiler: /usr/bin/c++ - skipped
54+ -- Detecting CXX compile features
55+ -- Detecting CXX compile features - done
56+ -- Configuring done (0.4s)
57+ -- Generating done (0.0s)
58+ -- Build files have been written to: /.../inplace_vector/build
59+
60+ # Build
61+ $ cmake --build build
62+ [ 50%] Building CXX object src/beman/inplace_vector/tests/CMakeFiles/beman.inplace_vector.test.dir/inplace_vector.test.cpp.o
63+ [100%] Linking CXX executable beman.inplace_vector.test
64+ [100%] Built target beman.inplace_vector.test
65+
66+ # Run tests
67+ $ ctest --test-dir build/
68+ Internal ctest changing into directory: /.../inplace_vector/build
69+ Test project /.../inplace_vector/build
70+ Start 1: beman.inplace_vector.test
71+ 1/1 Test #1: beman.inplace_vector.test ........ Passed 0.00 sec
72+
73+ 100% tests passed, 0 tests failed out of 1
74+
75+ Total Test time (real) = 0.01 sec
76+ ```
77+
78+ ## Development
79+
80+ ### Linting
1081
1182This project use [ pre-commit] ( https://pre-commit.com/ ) framework for linting.
1283
13- ### Install pre-commit
84+ #### Install pre-commit
1485
1586``` bash
1687pip3 install pre-commit
@@ -23,7 +94,7 @@ to install this functionality, run:
2394pre-commit install
2495```
2596
26- ### Running pre-commit
97+ #### Running pre-commit
2798
2899``` bash
29100pre-commit run --all-files
@@ -33,5 +104,3 @@ This will download and check linting rules on all files.
33104Apart from Markdown files,
34105` pre-commit ` will automatically format the files
35106to conform with linting rules in place.
36-
37- ### Run
0 commit comments