fix container.hpp to properly use std::next and std::end