diff --git a/include/seqan3/alphabet/container/bitpacked_sequence.hpp b/include/seqan3/alphabet/container/bitpacked_sequence.hpp index 53377ced7d..449d90a2ee 100644 --- a/include/seqan3/alphabet/container/bitpacked_sequence.hpp +++ b/include/seqan3/alphabet/container/bitpacked_sequence.hpp @@ -91,7 +91,7 @@ class bitpacked_sequence //!\brief Update the sdsl-proxy. constexpr void on_update() noexcept { - internal_proxy = static_cast(*this).to_rank(); + internal_proxy = base_t::to_rank(); } public: @@ -110,10 +110,12 @@ class bitpacked_sequence ~reference_proxy_type() noexcept = default; //!< Defaulted. //!\brief Initialise from internal proxy type. - reference_proxy_type(std::ranges::range_reference_t const & internal) noexcept : + reference_proxy_type(std::ranges::range_reference_t const internal) noexcept : internal_proxy{internal} { - static_cast(*this).assign_rank(internal); + // Call alphabet_base's assign_rank to prevent calling on_update() during construction + // which is not necessary, because internal_proxy is already correctly initialised! + base_t::base_t::assign_rank(static_cast>(internal)); } //!\} }; diff --git a/test/performance/range/container_push_back_benchmark.cpp b/test/performance/range/container_push_back_benchmark.cpp index a0d2c12a00..064c58729f 100644 --- a/test/performance/range/container_push_back_benchmark.cpp +++ b/test/performance/range/container_push_back_benchmark.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include template @@ -31,14 +32,14 @@ using small_vec = seqan3::small_vector; template