1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once


#include <functional><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <optional><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <cassert><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.


#include "internal/dev_env.hpp"
#include "internal/types.hpp"


namespace uni {


template<class Container>
struct auto_expander : Container {
    using size_type = Container::size_type;

  public:
    template<class... Args>
    explicit auto_expander(Args&&... args) noexcept(NO_EXCEPT) : Container(std::forward<Args>(args)...) {}

    inline auto& operator[](const size_type pos) noexcept(NO_EXCEPT) {
        if(this->size() <= pos) this->Container::resize(pos + 1);
        return this->Container::operator[](pos);
    }
};


}