Integrating a C++20 like span library

https://github.com/tcbrindle/span

Replacing a homebrew const pointer wrapper const correctness helper
with the C++20 like span library.

One day when we switch to C++20 we will just use the C++20 spans instead.
This commit is contained in:
Vojtech Bubnik 2022-10-19 16:26:59 +02:00
parent acbc60f3e3
commit 2ced762948
12 changed files with 770 additions and 57 deletions

View file

@ -18,7 +18,7 @@ SCENARIO("PrintObject: object layer heights", "[PrintObject]") {
{ "layer_height", 2 },
{ "nozzle_diameter", 3 }
});
ConstLayerPtrsAdaptor layers = print.objects().front()->layers();
SpanOfConstPtrs<Layer> layers = print.objects().front()->layers();
THEN("The output vector has 10 entries") {
REQUIRE(layers.size() == 10);
}
@ -37,7 +37,7 @@ SCENARIO("PrintObject: object layer heights", "[PrintObject]") {
{ "layer_height", 10 },
{ "nozzle_diameter", 11 }
});
ConstLayerPtrsAdaptor layers = print.objects().front()->layers();
SpanOfConstPtrs<Layer> layers = print.objects().front()->layers();
THEN("The output vector has 3 entries") {
REQUIRE(layers.size() == 3);
}
@ -55,7 +55,7 @@ SCENARIO("PrintObject: object layer heights", "[PrintObject]") {
{ "layer_height", 15 },
{ "nozzle_diameter", 16 }
});
ConstLayerPtrsAdaptor layers = print.objects().front()->layers();
SpanOfConstPtrs<Layer> layers = print.objects().front()->layers();
THEN("The output vector has 2 entries") {
REQUIRE(layers.size() == 2);
}