like std::vector without iterator