Skip to content
Snippets Groups Projects
Commit 8e17f12e authored by Simon Praetorius's avatar Simon Praetorius
Browse files

Replace the raw array in ReservedVector by std::array

parent d79557a1
No related branches found
No related tags found
1 merge request!1078Replace the raw array in ReservedVector by std::array
Pipeline #42384 passed
Pipeline: Dune Nightly Test

#42385

    ......@@ -8,6 +8,7 @@
    */
    #include <algorithm>
    #include <array>
    #include <iostream>
    #include <cstddef>
    #include <dune/common/genericiterator.hh>
    ......@@ -73,7 +74,7 @@ namespace Dune
    {
    assert(l.size() <= n);// Actually, this is not needed any more!
    sz = l.size();
    std::copy_n(l.begin(), sz, data);
    std::copy_n(l.begin(), sz, data.data());
    }
    /** @} */
    ......@@ -216,11 +217,11 @@ namespace Dune
    inline friend std::size_t hash_value(const ReservedVector& v) noexcept
    {
    return hash_range(v.data,v.data+v.sz);
    return hash_range(v.data.data(),v.data.data()+v.sz);
    }
    private:
    T data[n] = {};
    std::array<T,n> data = {};
    size_type sz = 0;
    };
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment