Repository navigation
Home
Frank Columbo edited this page Jul 17, 2017
·
43 revisions
Constainer provides a constexpr-capable set of container and algorithm templates with interfaces identical to STL- and Boost-containers.
constexpr auto str = ("Hello"_cstr + " co").replace(6, 2, "constexpr!")
.append(2, '!').substr(0, 16);
static_assert( str == "Hello constexpr!" );
- A static printf implementation, fully supporting conventional syntax and more!
- Sophisticated parsers for both floating point and integer types.
-
Array, an
std::arrayclone. -
BasicVector, an
std::vectorclone. -
BasicString, an
std::basic_stringclone. - Bitset, an efficient bitset with extra functionality
-
StableVector, a
boost::container::stable_vectorclone. List-like iterator stability meets random-access. -
FlatSet, FlatMultiSet, FlatMap, FlatMultiMap, which are a mix of
boost::container::flat_*and the standard associative containers. And don't forget the stable counterpartsStableFlatSet,StableFlatMultiSet,StableFlatMapandStableFlatMultimap.
-
Algorithms as known from
<algorithm>and<iterator>, and extensions (e.g.iota_n,find_first_not_of) -
ADL-supporting range access functions, including
begin/end(withr- andc- versions),sizeanddecayed_begin/-end -
Iterator adaptors: Fully implemented
reverse_iterator,move_iteratorandtransform_iterator. - Iterator concepts
- A few mathematical functions, including
safeMul(floating point multiplication avoiding implicit overflows so as to preserveconstexpr-ness),pow(Real, int),pow10(Real), normalization and floating point modulo - .. and more! Check out the test file for examples.
| Compiler | Support/Version | Notes |
|---|---|---|
| Clang |
Yes: 3.7.1 Partially with 3.6. |
Works partially with 3.6, has problems with stable containers though. See issue #1. |
| GCC | Partially. | See issues #2 and #3. Should probably be ready to work once both bugs are fixed. Static Printf works. |
| ICC | No |
ICC doesn't properly support constexpr yet. It also ICEs on Constainer/Array.hxx (with 20150407). |
| VC++ | No | VC++ runs far behind GCC and Clang, missing fundamental features like extended constexpr and expression SFINAE. |
Further notes: ICC is also incompatible because a (soon to be published) "static" version of printf requires string literal operator templates, which ICC does not support at the moment.
Avoid usage of any entities in this library unless you need constant expressions. This library is in alpha state, only marginally tested and incomplete.