Fix single

This commit is contained in:
Simon Giraudot 2020-08-25 13:48:48 +02:00
parent 2992fcc508
commit ff845cc7ca
1 changed files with 5 additions and 7 deletions

View File

@ -22,21 +22,19 @@ class Single
public: public:
typedef T* iterator; typedef T* iterator;
typedef const T* const_iterator; typedef T* const_iterator;
typedef std::size_t size_type; typedef std::size_t size_type;
private: private:
const T& t; T& t;
public: public:
Single (const T& t) : t(t) { } Single (T& t) : t(t) { }
const_iterator begin() const { return &t; } iterator begin() const { return &t; }
iterator begin() { return &t; } iterator end() const { return &t + 1; }
const_iterator end() const { return &t + 1; }
iterator end() { return &t + 1; }
constexpr size_type size() const { return 1; } constexpr size_type size() const { return 1; }
constexpr bool empty() const { return false; } constexpr bool empty() const { return false; }