简体   繁体   English

是否有不属于C ++标准库的STL标头?

[英]Are there any STL headers which are not part of the C++ Standard Library?

I know that some C++ Standard Library headers are originated from the STL, such as vector . 我知道某些C ++标准库标头源自STL,例如vector But I'm failing to find an up-do-date list of STL headers which are still not incorporated by the Standard Library. 但是我找不到标准库仍未合并的STL标头的最新列表。 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. PS:我想列出它们,并且想知道是否所有主要的实现都包括它们或从哪里获得它们。

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: 如果我们查看SGI的STL文档,则会发现以下内容:

  1. slist has been renamed std::forward_list . slist已重命名为std::forward_list
  2. bit_vector has been replaced by a template specification of std::vector<bool> . bit_vector已由std::vector<bool>的模板规范代替。 The implementation of this may (not must) optimize for space in the way that bit_vector does. 这样的实现可以(不是必须)以bit_vector的方式优化空间。
  3. hash_set and friends are now spelled like unordered_set . hash_set和朋友现在的拼写就像unordered_set Functionality seems to be the same. 功能似乎是相同的。 (Thanks TC!) (感谢TC!)
  4. rope is missing. rope不见了。 There is no equivalent data structure in the standard library. 标准库中没有等效的数据结构。 I could not find a relevant WG21 discussion on the topic. 我找不到与此主题相关的WG21讨论。
  5. sequence_buffer is missing, because this was primarily used for back inserting a rope . 缺少sequence_buffer ,因为它主要用于向后插入rope
  6. random_sample and random_sample_n are missing. 缺少random_samplerandom_sample_n The reason is discussed in N3547: 原因在N3547中讨论:

    After WG21 consideration at the Sophia-Antipolis meeting, Austern updated the proposal. 在WG21在Sophia-Antipolis会议上进行审议之后,Austern更新了该提案。 Among other changes, he withdrew [ random_sample and random_sample_n ]: “The LWG was concerned that they might not be well enough understood for standardization. 除其他更改外,他撤回了[ random_samplerandom_sample_n ]:“ LWG担心他们对标准化可能不够了解。 . . . It may be appropriate to propose those algorithms for TR2” [ Aus08b ]. 为TR2提出这些算法可能是适当的” [Aus08b]。 The wiki minutes of the discussion are equally terse: “Bjarne feels rationale is insufficient. 讨论的Wiki分钟同样简短:“ Bjarne觉得理由不足。 PJ worries we will get it wrong. PJ担心我们会弄错。 Lawrence worries that people will roll their own and get it wrong. 劳伦斯担心人们会自己滚蛋并弄错了。 Good candidate for TR2” [ LWG08 ]. 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) 随后对这些拟议算法的投票获得了可靠的LWG共识(10-1,2 abs。),赞成将其将来纳入技术报告(现称为技术规范)

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. random_sample_n算法的一个版本已添加到Library Fundamentals TS中,并称为std::experimental::sample ,提案N3925的最新版本已于2014-02年采用,但仍未成为标准的一部分,我想我们将在C ++ 17中看到。 (Thanks TC!) (感谢TC!)

  1. lexicographical_compare_3way is missing. lexicographical_compare_3way丢失。 It was seen as "not important enough" to standardize according to N2666. 根据N2666,它被认为“不够重要”,无法进行标准化。
  2. power is spelled pow and does not have the generalized capabilities that power does. power拼写pow ,没有广义的能力, power一样。
  3. identity , project1st , project2nd , select1st and select2nd never made it to standardization. identityproject1stproject2ndselect1stselect2nd从未实现标准化。 I could not find a discussion regarding why. 我找不到关于原因的讨论。
  4. subtractive_rng is missing as well. subtractive_rng也丢失。 Presumptively because <random> would be superseding this problem space. 推测是因为<random>将取代此问题空间。
  5. binder1st , binder2nd , ptr_fun , pointer_to_unary_function , pointer_to_binary_function , mem_fun (and friends), unary_compose , and binary_compose are missing or deprecated. 缺少或不推荐使用binder1stbinder2ndptr_funpointer_to_unary_functionpointer_to_binary_functionmem_fun (和朋友), unary_composebinary_compose They are more or less superseded by std::bind and friends. 它们或多或少地被std::bind和朋友所取代。
  6. construct and destroy have been moved into the allocator class and do not exist as standalone functions. constructdestroy已移到allocator类中,并且不作为独立函数存在。 (Thanks TC!) (感谢TC!)
  7. temporary_buffer is missing. temporary_buffer缓冲区丢失。 But get_temporary_buffer and return_temporary_buffer are available. 但是get_temporary_bufferreturn_temporary_buffer可用。 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. 我还无法确切找到原因,但是我遇到的chat不休似乎暗示它在某种程度上从根本上被打破了,许多人都在尝试修复它。 Exactly what and how remains a mystery to me. 究竟是什么以及如何成为我的谜。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM