-
Notifications
You must be signed in to change notification settings - Fork 11
Draft Readme #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Draft Readme #12
Changes from 3 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,84 @@ | ||
| # beman.inplace\_vector: A dynamically-resizable vector with fixed capacity and embedded storage | ||
|
|
||
| <!-- | ||
| SPDX-License-Identifier: <SPDX License Expression> | ||
| --> | ||
|
|
||
| # 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) | ||
wusatosi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Usage | ||
|
|
||
| ### 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<T, A>`, | ||
| 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 | ||
| ``` | ||
|
|
||
| ## How to Build | ||
|
|
||
| ### Compiler support | ||
|
|
||
| Building this repository requires **C++20** or later. | ||
|
|
||
| ### Dependencies | ||
|
|
||
| TODO: tested platforms. | ||
|
|
||
| ### Instructions | ||
|
|
||
| <!-- TODO: add preset support --> | ||
|
|
||
| #### 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 | ||
| ``` | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.