Skip to content

Commit 7ff1867

Browse files
committed
Update README.md
1 parent d29d145 commit 7ff1867

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,23 @@ Note this is not part of the standard Library and should not be relied on once
9595
Example Usage:
9696
`static_assert(beman::has_constexpr_support<beman::inplace_vector<int, 5>>)`.
9797
98+
### Freestanding
99+
100+
`beman::freestanding::inplace_vector` implements a minimal freestanding version of the specification,
101+
which marks all potentially throwing functions as `= deleted`.
102+
This is useful for platforms without exception support, as it will generate a compile-time error
103+
instead of a potential runtime error when trying to use a throwing function.
104+
105+
``` C++
106+
beman::inplace_vector<int, 1> iv;
107+
iv.resize(0); // OK
108+
iv.resize(10); // will throw or abort
109+
110+
beman::freestanding::inplace_vector<int, 1> fs_iv;
111+
fs_iv.resize(0); // will generate a compile-time error
112+
fs_iv.resize(10); // will generate a compile-time error
113+
```
114+
98115
## How to Build
99116

100117
### Compiler support

0 commit comments

Comments
 (0)