Skip to content

Commit b93683d

Browse files
authored
Merge pull request #90 from 20162026/feature/freestandingnamespace
freestanding namespace
2 parents ec60ea1 + 35858f7 commit b93683d

File tree

6 files changed

+764
-251
lines changed

6 files changed

+764
-251
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)