是否有不属于C ++标准库的STL标头? [英] Are there any STL headers which are not part of the C++ Standard Library?
问题描述
我知道某些C ++标准库标头来自STL,例如 vector
。但是我找不到标准库仍未包含的STL标头的最新列表。它们存在吗?
PS:我想将它们列出,并想知道是否所有主要的实现都包括它们,或者在可能的情况下从哪里获得。
p>注意,这是按功能分解的函数,而不是按标头分解的函数,因为它似乎更有用。 / p>
如果我们查看 SGI的文档STL 我们发现以下内容:
-
slist
已重命名std :: forward_list
。 -
bit_vector
已被替换为模板规范std :: vector< bool>
。这样的实现可以(不是必须)以bit_vector
的方式优化空间。 -
hash_set
和朋友现在的拼写类似于unordered_set
。功能似乎是相同的。 (感谢T.C。!) 缺少 -
绳索
。标准库中没有等效的数据结构。我找不到与此主题相关的WG21讨论。 -
sequence_buffer
丢失了,因为这主要是用于向后插入绳子
。 -
random_sample
和random_sample_n
丢失。原因在N3547中进行了讨论:
在WG21在Sophia-Antipolis会议上进行审议之后,Austern更新了该提案。
在其他更改中,他撤回了[random_sample
和random_sample_n
]: LWG担心他们可能对于标准化还不够了解。 。 。 。建议
用于TR2的算法是适当的 [
Aus08b
]。讨论的Wiki分钟同样简短: Bjarne
感到理由不足。 PJ担心我们会弄错。劳伦斯担心,人们会自己动手弄错。 TR2的好候选人 [
LWG08
]。随后对这些拟议算法的
投票获得了可靠的LWG共识(10-1,2 abs。),赞成将其将来的
纳入技术报告(现称为技术规范)
random_sample_n
算法的一个版本已提交到图书馆基础知识TS,并称为 std :: experimental :: sample
,提案N3925的最新版本已于2014-02年采用,但仍未包括在内标准,我想我们会在C ++ 17中看到。 (感谢T.C。!)
-
lexicographical_compare_3way
丢失。根据N2666,它被认为不够重要。 -
power
的拼写是pow
,并且没有power
具备的一般功能。 -
身份
,project1st
,project2nd
,select1st
和select2nd
从未实现标准化。我找不到关于原因的讨论。 -
subtractive_rng
也丢失了。推测是因为< random>
将取代此问题空间。 -
binder1st
,binder2nd
,ptr_fun
,pointer_to_unary_function
,pointer_to_binary_function
,mem_fun
(和朋友),unary_compose
和binary_compose
丢失或不建议使用。他们或多或少地被std :: bind
和朋友所取代。 -
构造
和destroy
已被移至allocator
类,并且不作为独立函数存在。 (感谢T.C。!) -
temporary_buffer
丢失。但是get_temporary_buffer
和return_temporary_buffer
可用。我还无法确切找到原因,但是我遇到的chat不休似乎暗示它在某种程度上从根本上被打破了,许多人一直在尝试对其进行修复。到底是什么以及如何成为我的谜。
I know that some C++ Standard Library headers are originated from the STL, such as vector
. But I'm failing to find an up-do-date list of STL headers which are still not incorporated by the Standard Library. Do they exist?
PS: I would like to have them listed, and also to know if all major implementations include them or where to get them, if possible.
Note, this is a function by function break down, rather than a by header breakdown, because it seems to be more useful.
If we examine SGI's documentation of the STL we find the following:
slist
has been renamedstd::forward_list
.bit_vector
has been replaced by a template specification ofstd::vector<bool>
. The implementation of this may (not must) optimize for space in the way thatbit_vector
does.hash_set
and friends are now spelled likeunordered_set
. Functionality seems to be the same. (Thanks T.C.!)rope
is missing. There is no equivalent data structure in the standard library. I could not find a relevant WG21 discussion on the topic.sequence_buffer
is missing, because this was primarily used for back inserting arope
.random_sample
andrandom_sample_n
are missing. The reason is discussed in N3547:After WG21 consideration at the Sophia-Antipolis meeting, Austern updated the proposal. Among other changes, he withdrew [
random_sample
andrandom_sample_n
]: "The LWG was concerned that they might not be well enough understood for standardization. . . . It may be appropriate to propose those algorithms for TR2" [ Aus08b ]. The wiki minutes of the discussion are equally terse: "Bjarne feels rationale is insufficient. PJ worries we will get it wrong. Lawrence worries that people will roll their own and get it wrong. Good candidate for TR2" [ LWG08 ]. The subsequent vote regarding these proposed algorithms achieved a solid LWG consensus (10-1, 2 abs.) in favor of their future inclusion in a Technical Report (now termed a Technical Specification)
A version of the random_sample_n
algorithm has made it to the Library Fundamentals TS and is called std::experimental::sample
, the latest iteration of the proposal N3925 was adopted in 2014-02 but remains not yet part of the standard, I suppose we'll see in in C++17. (Thanks T.C.!)
lexicographical_compare_3way
is missing. It was seen as "not important enough" to standardize according to N2666.power
is spelledpow
and does not have the generalized capabilities thatpower
does.identity
,project1st
,project2nd
,select1st
andselect2nd
never made it to standardization. I could not find a discussion regarding why.subtractive_rng
is missing as well. Presumptively because<random>
would be superseding this problem space.binder1st
,binder2nd
,ptr_fun
,pointer_to_unary_function
,pointer_to_binary_function
,mem_fun
(and friends),unary_compose
, andbinary_compose
are missing or deprecated. They are more or less superseded bystd::bind
and friends.construct
anddestroy
have been moved into theallocator
class and do not exist as standalone functions. (Thanks T.C.!)temporary_buffer
is missing. Butget_temporary_buffer
andreturn_temporary_buffer
are available. I haven't been able to find out exactly why, but what chatter I have ran across seems to imply that it's broken in some way pretty fundamentally, and lots of people have been trying to fix it. Exactly what and how remains a mystery to me.
这篇关于是否有不属于C ++标准库的STL标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!