Skip to content
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

[FixedString] Take out of detail namespace, add to README, add a lot of missing functions #68

Merged
merged 25 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
430a3db
Take FixedString out of detail namespace
alexkaratarakis Sep 23, 2023
7008530
Add FixedString to README.md
alexkaratarakis Sep 24, 2023
01aa089
[FixedString] Switch to FixedVector for underlying data
alexkaratarakis Sep 26, 2023
daf3c31
[FixedString] Implement constructors, iterators, push_back(), erase()…
alexkaratarakis Sep 26, 2023
abbb378
[Vector/Deque<->String consistency] PushBaback_Exceeds and EraseOne fix
alexkaratarakis Sep 26, 2023
c1ac258
[FixedString] Implement primaryassign() overloads
alexkaratarakis Sep 26, 2023
944c60e
[Vector/Deque<->String consistency] Reorder Assign_ExceedsCapacity tests
alexkaratarakis Sep 26, 2023
e84bc66
[FixedString] Implement front()/back()
alexkaratarakis Sep 26, 2023
6c8fd8f
[FixedString] Reorder data() test
alexkaratarakis Sep 26, 2023
4806fcd
[FixedString] Implement c_str()
alexkaratarakis Sep 26, 2023
a41ffe0
[FixedString] Reorder string_view auto-conversion
alexkaratarakis Sep 26, 2023
0893f23
[FixedString] Implement reserve()
alexkaratarakis Sep 26, 2023
835a383
[FixedString] Reorder empty()/size()/max_size() tests
alexkaratarakis Sep 26, 2023
9911870
[FixedString] Implement clear()
alexkaratarakis Sep 26, 2023
17c2258
[Vector/Deque<->String consistency] Reorder and rename insert(iterato…
alexkaratarakis Sep 26, 2023
cb28b96
MockIntStream -> MockIntegralStream<T>
alexkaratarakis Sep 26, 2023
4bffaae
[FixedString] Implement primary insert() overloads
alexkaratarakis Sep 26, 2023
cd9dcee
[FixedString] Implement pop_back()
alexkaratarakis Sep 26, 2023
13259d1
[FixedString] Implement primary append() and += overloads
alexkaratarakis Sep 26, 2023
f1e4ee9
[FixedString] Implement ==, <=>, compare
alexkaratarakis Sep 26, 2023
c8d8a85
[FixedString] Implement starts_with(), ends_with(), substr()
alexkaratarakis Sep 26, 2023
2eb29a1
[FixedString] Implement resize()
alexkaratarakis Sep 26, 2023
d1874f0
[Vector/Deque<->String consistency] test formatting
alexkaratarakis Sep 27, 2023
eaa9ecb
[FixedString] Implement is_full() and make_fixed_string()
alexkaratarakis Sep 26, 2023
0fc561a
[FixedString] Add test for CTAD, ADL and instance usage in templates
alexkaratarakis Sep 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ cc_library(
includes = ["include"],
deps = [
":concepts",
":fixed_vector",
":preconditions",
":source_location",
":string_literal",
Expand Down Expand Up @@ -692,6 +693,8 @@ cc_test(
":concepts",
":consteval_compare",
":fixed_string",
":mock_testing_types",
":test_utilities_common",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Header-only C++20 library that provides containers with the following properties
* `EnumMap`/`EnumSet` - For enum keys only, Map/Set implementation with `std::map`/`std::set` API and "fixed container" properties. O(1) lookups.
* `FixedDeque` - Deque implementation with `std::deque` API and "fixed container" properties
* `FixedStack` - Stack implementation with `std::stack` API and "fixed container" properties
* `FixedString` - String implementation with `std::string` API and "fixed container" properties
* `StringLiteral` - Compile-time null-terminated literal string.
* Rich enums - `enum` & `class` hybrid.

Expand Down Expand Up @@ -170,6 +171,22 @@ More examples can be found [here](test/enums_test_common.hpp).
static_assert(s1.size() == 2);
```

- FixedString
```C++
constexpr auto v1 = []()
{
FixedString<11> v{"012"};
v.at(1) = 'b';

return v;
}();

static_assert(v1.at(0) == '0');
static_assert(v1.at(1) == 'b');
static_assert(v1.at(2) == '2');
static_assert(v1.size() == 3);
```

- StringLiteral
```C++
static constexpr const char* s = "blah"; // strlen==4, sizeof==8
Expand Down
Loading
Loading