Add implementation

This commit is contained in:
Bruno BELANYI 2024-08-23 23:49:52 +01:00
parent 65e0d4991f
commit 4ab8dd37ff

View file

@ -14,7 +14,14 @@ public:
void assign(K const& begin, K const& end, V const& val) { void assign(K const& begin, K const& end, V const& val) {
if (!(begin < end)) if (!(begin < end))
return; return;
// TODO: implement
auto const end_val = (*this)[end];
underlying_.erase(underlying_.lower_bound(begin),
underlying_.upper_bound(end));
if (!((*this)[begin] == val))
underlying_.insert({begin, val});
if (!((*this)[end] == end_val))
underlying_.insert({end, end_val});
} }
V const& operator[](K const& key) const { V const& operator[](K const& key) const {