Changed array to std::vector in Layer impl