diff --git a/include/boost/icl/interval_map.hpp b/include/boost/icl/interval_map.hpp index ffddc3e..8ab52cc 100644 --- a/include/boost/icl/interval_map.hpp +++ b/include/boost/icl/interval_map.hpp @@ -92,6 +92,15 @@ class interval_map: explicit interval_map(const value_type& value_pair): base_type() { this->add(value_pair); } + /// Constructor for a range of intervals + template + interval_map(InputIterator first, const InputIterator last) + { + for (; first != last; ++first) + { + this->add(*first); + } + } /// Assignment from a base interval_map. template diff --git a/include/boost/icl/interval_set.hpp b/include/boost/icl/interval_set.hpp index 22f97a4..dc7642d 100644 --- a/include/boost/icl/interval_set.hpp +++ b/include/boost/icl/interval_set.hpp @@ -115,6 +115,16 @@ class interval_set: this->add(itv); } + /// Constructor for a range of intervals + template + interval_set(InputIterator first, const InputIterator last) + { + for (; first != last; ++first) + { + this->add(*first); + } + } + /// Assignment from a base interval_set. template void assign(const interval_base_set& src)