Skip to content

Adapted code to newest gsl::span

Sebastien Ponce requested to merge sponce_fixedSimilaritydev4 into master

Quite trivial fix but I do not understand why we need it. Maybe @graven can comment ?

As an hint, here is the relevant change in the gsl::span code :

-    constexpr span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
+    template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent != gsl::dynamic_extent, int> = 0>
+    constexpr explicit span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
     {
-        if (Extent != dynamic_extent) Expects(count == Extent);
+        Expects(count == Extent);
     }

I suppose the templating breaks the usage of initializer list ?

Edited by Rosen Matev

Merge request reports