From a5ba3bdf337dd8000d124ac01e722b064e2366b8 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 23 May 2021 14:25:28 +0200 Subject: [PATCH] Also define type erased small_vector extension So bitsery knows how to handle small vectors that don't have a compile time known size as well. --- src/common/bitsery/traits/small-vector.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/common/bitsery/traits/small-vector.h b/src/common/bitsery/traits/small-vector.h index d3c4126a..b87ce692 100644 --- a/src/common/bitsery/traits/small-vector.h +++ b/src/common/bitsery/traits/small-vector.h @@ -40,5 +40,21 @@ struct BufferAdapterTraits> : public StdContainerForBufferAdapter< boost::container::small_vector> {}; +// And the same extensions again for the type erased version + +template +struct ContainerTraits> + : public StdContainer, + true, + true> { + static_assert(boost::container::dtl::is_contiguous_container< + boost::container::small_vector_base>::value); +}; + +template +struct BufferAdapterTraits> + : public StdContainerForBufferAdapter< + boost::container::small_vector_base> {}; + } // namespace traits } // namespace bitsery