Back to Basics: Almost Always Vector - Kevin Carpenter - CppCon 2024

preview_player
Показать описание
---

Back to Basics: Almost Always Vector - Kevin Carpenter - CppCon 2024
---

Are you a fresh face in the world of C++ development, or perhaps you've got a bit of experience under your belt? Have you ever stopped to marvel at just how often std::vector pops up? It's a thing of beauty, a structure you can just keep piling data into, effortlessly sort, search, insert, and delete from. But do you know the price you pay for all this convenience? What about when you need to expand the structure? Or when you're on the hunt for something specific? Ever dabbled with custom predicates to dynamically tweak your data? With a plethora of data structures at our disposal in the standard library, it's a head-scratcher why std::vector seems to steal the show.

Join this talk to unravel the mystery behind why we almost always opt for std::vector, and learn how to wield it with maximum efficiency.
---

---

Kevin Carpenter

Kevin Carpenter, an experienced Software Engineer, excels in crafting high-availability C++ solutions for Linux and Windows, with expertise in transaction software, financial modelling, and system integration. As a Lead Project Engineer, he ensures secure, high-speed credit card transactions. In his prior position, he played a lead role in developing an interest rate risk model for large credit unions, enhancing legacy code, and optimizing ERP data integration.

Kevin actively engages in the C++ community, volunteering at conferences like ACCU, CppCon, C++ on Sea, and SwiftCraft, where he holds key positions such as Speaker Liaison and Volunteer Coordinator/Chair. His diverse contributions to the C++ community showcase his commitment to excellence and drive for collaborative growth, leaving a lasting impact in the tech world.
---

CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
---

---

#cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #softwaredevelopment #softwareengineering #coding #code #computerscience #technology #technews #programming #programmer
Рекомендации по теме
Комментарии
Автор

Love all the feedback on this talk, thank you. Thanks @Roibarkan for the follow up answers, they are spot on. 😃

cppevents
Автор

59:36 As of C++20, I try to use ranges to wrangle vectors. For example “for (auto& x : drop_view(vec, 10)) {…}” will safely skip the first 10 elements of vec, and simply perform no iterations if vec has fewer than 10 elements

Roibarkan
Автор

I know this talk is about std::vector, but for the slide about "old c style reallocation" I noticed that there was a missing delete[] for temp. I was curious to see if temp was still accessible after cArray's final delete and it was, but also was surprised to see that indexing cArray was still accessible as well (probably undefined behavior territory?). Putting deletes for both and then attempting to index into them gave the expected error of crashing (it didn't look like it crashed as it just returned to the prompt but found STATUS_HEAP_CORRUPTION in Event Viewer). I suppose this is all a long-winded way of saying...there should've been a delete[] temp; in addition to delete[] cArray; at the end of that snippet, right?

ZHDINC
Автор

For those who is thinking if this video worth watching: it has only basics, nothing advanced.

LyolikZzz
Автор

The quality of people who you meet over coffee is amazing.❤

letsbegin_staytrue
Автор

what was this benchmark bs at 50:55 ???
doing 10x the work in 2x time obviously means you have been doing something else

AtomicAndi
Автор

I don’t understand the point of this talk. It seems to be about how vector is convenient, which isn’t particularly interesting. Not to mention, a lot of his examples are horribly contrived especially the strange code he calls c-style which nobody would ever want to write.

I just don’t think I understand this talk

countchocula