http://CppCon.org
—
Discussion & Comments: https://www.reddit.com/r/cpp/
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2019
—
The proposed new STL containers "flat_set" and "flat_map" work like "priority_queue" in that they adapt some existing container, such as std::vector or std::deque, by combining it with other user-provided components, such as a comparator. Such composed types generally impose vague semantic requirements on their components; for example, a composed type might implicitly require that copy-construction and assignment do "the natural thing." These semantic requirements are hardly ever stated explicitly in the Standard; instead, they fall out of common vendor implementations.
In committee discussion of "flat_map", it was noticed that container adaptors such as "priority_queue" also implicitly require some sort of exception guarantee. Not only does the library require that successful copy-assignment actually do assignment, but also, the library generally requires that unsuccessful copy-assignment should do nothing at all — a property referred to as the "strong exception guarantee."
Arthur will show some examples where a user-provided comparator that throws can break the class invariants of "priority_queue". Once the class invariants of a container have been broken, we say that the container is in a "mostly invalid" state — a different and even more dangerous state than the "valid but unspecified" state of a moved-from object. We'll walk through several strategies for inserting values into a flat_map and show how each one breaks down when confronted with a throwing move-constructor, a throwing comparison, or both. Finally, Arthur will suggest a path forward for formalizing the currently underspecified behavior of STL types that rely on user-provided components.
—
Arthur O'Dwyer
New York
Arthur O'Dwyer is the author of "Colossal Cave: The Board Game," "Mastering the C++17 STL" (the book), and "The STL From Scratch" (the training course). He runs professional C++ training courses, is occasionally active on the C++ Standards Committee, and has a blog mostly about C++.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
c thomas howell CppCon 2019: Arthur O'Dwyer “"Mostly Invalid": flat_map, Exception Guarantees, and the STL” | |
| 16 Likes | 16 Dislikes |
| 1,152 views views | 63.8K followers |
| Education | Upload TimePublished on 30 Sep 2019 |
Related keywords
c train schedule,c diff,c corporation,c town,c train service,video services uiuc,video services unlimited,c section scar,c to k,video services inc,video services contract,c battery,video services of america,c span,video services on switch,video services list,c street,c suite,video services group,video services of va,video services near me,video services like netflix,c chord guitar,video services boise,c train status,video services conroe tx,video services forum,c section,video services other than youtube,video services group inc,c train,video services like youtube,c to f,c stock,c reactive protein,video services before youtube,video services pricing,video services contract template,c elegans,
Không có nhận xét nào:
Đăng nhận xét