front and back Proposal for iterators Library

ぃ、小莉子 提交于 2019-12-11 13:56:09

问题


In C++17 the iterator library received size, empty, and data allowing statically constructed arrays to behave like containers.

But I don't see a front or back function in the iterator library, which was added to the other containers in C++14: http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=front&button=

Is this something that has been proposed?


回答1:


N4017 originally proposed front/back.

The Library Evolution Working Group voted to remove front/back:

Do we want non-member front(), back()?

SF F N A SA
0  6 5 3 1

[Source]

As a result N4107 was revised to N4155 and has been accepted sans front/back.

As of 02/18/16 front/back have not been reproposed: https://groups.google.com/a/isocpp.org/d/topic/std-discussion/eJdDI2q1xKg/discussion



来源:https://stackoverflow.com/questions/36265718/front-and-back-proposal-for-iterators-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!