Workaround for std::list::size() having linear complexity on some implementations