Allow random::weighted_distribution to release it's weights array

This commit is contained in:
Nikita Lisitsa 2023-04-02 11:56:02 +03:00
parent 7ae3bbfe96
commit 3bfe867cc0

View file

@ -38,6 +38,11 @@ namespace psemek::random
return it - prefix_sum_.begin(); return it - prefix_sum_.begin();
} }
std::vector<T> release()
{
return std::move(prefix_sum_);
}
private: private:
std::vector<T> prefix_sum_; std::vector<T> prefix_sum_;
}; };