Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f21f1fec authored by Nader Jawad's avatar Nader Jawad
Browse files

Add initializer support to FatVector

Added constructor to FatVector to support C++ initializer
list usage

Test: Added tests to CanvasOpTest
Change-Id: If28066af1b1d747bab4e01b4d6a563412a11e7ec
parent 4a1d020d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -82,6 +82,12 @@ public:
        this->reserve(SIZE);
    }

    FatVector(std::initializer_list<T> init)
          : std::vector<T, InlineStdAllocator<T, SIZE>>(init,
                                                        InlineStdAllocator<T, SIZE>(mAllocation)) {
        this->reserve(SIZE);
    }

    explicit FatVector(size_t capacity) : FatVector() { this->resize(capacity); }

private: