Closed Crzyrndm closed 4 months ago
I have no meaningful opinion on the actual feature request, but I'll just leave this here: std::is_constructible_v<int[10], size_t>
is true
in C++20, because of paren-agg-init. https://quuxplusone.github.io/blog/2022/06/03/aggregate-parens-init-considered-kinda-bad/
@Crzyrndm Thanks for the heads-up.
Enabling the use of a C-array as template parameters requires some more work.
@Crzyrndm C-array and std::array
are now supported as the backing container.
So now one can write:
nonstd::ring< int[3] > r;
nonstd::ring< std::array<int, 3 >> s;
Completed.
ring
type here being the owning buffer that wraps a container and aring_span
. Right now thering
type is unable to use a fixed size array as the backing container because the only constructor requires a capacity argument https://github.com/martinmoene/ring-span-lite/blob/master/include/nonstd/ring.hpp#L51-L54all that is required to support
ring<std::array<T, N>>
is conditionally adding a default ctor (I've made it conditional on not having awith_capacity
ctor here) https://github.com/Crzyrndm/ring-span-lite/blob/array-ctor/include/nonstd/ring.hpp#L52-L56Built in / C array support would probably only require changing
.begin()/end()to
std::begin/end`Not sure if that's the right condition to use but it's working for the moment