use the explicit type for iterators in return types
This commit is contained in:
parent
300007ee6b
commit
4583e1a740
@ -89,14 +89,17 @@ template <typename T> class flat_set {
|
|||||||
using key_type = T;
|
using key_type = T;
|
||||||
using container_type = std::vector<T>;
|
using container_type = std::vector<T>;
|
||||||
|
|
||||||
|
using iterator = typename std::vector<T>::iterator;
|
||||||
|
using const_iterator = typename std::vector<T>::const_iterator;
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
explicit flat_set(Ts&&... args) : c{std::forward<Ts>(args)...} {}
|
explicit flat_set(Ts&&... args) : c{std::forward<Ts>(args)...} {}
|
||||||
|
|
||||||
auto begin() -> decltype(auto) { return c.begin(); }
|
iterator begin() { return c.begin(); }
|
||||||
auto begin() const -> decltype(auto) { return c.begin(); }
|
const_iterator begin() const { return c.begin(); }
|
||||||
|
|
||||||
auto end() -> decltype(auto) { return c.end(); }
|
iterator end() { return c.end(); }
|
||||||
auto end() const -> decltype(auto) { return c.end(); }
|
const_iterator end() const { return c.end(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<T> c;
|
std::vector<T> c;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user