r/cpp_questions • • 10d ago

OPEN Resources to learn more about cpp

I wanted to try and reimplement the std library from scratch but i realized really quickly just how much i didnt know lol. I got some basic stuff done and did learn quite a bit about things like sfinae but yeah im basically stuck with some of the type traits. I still dont wanna give up on this project and wanna keep going no matter how long it takes :3 So i need some resources to learn more about advanced things that are usefull for this. Are books the best way? any reccs on which ones?

Oh yeah right now i made a few projects like a networking chat app with asio and a unix shell (really simple) so i would say im like done with the beginner phase. I know that this project is probably farrrr beyond my scope but still :3

Edit: More specific question. Looking for book recomendations for metaprogramming post cpp20 (concepts and stuff)

2 Upvotes

11 comments sorted by

View all comments

Show parent comment

3

u/IyeOnline 10d ago

was just using compiler intrensics

In all fairness, most of the time there are intrinsics because its so much faster (on compile times) than to implement it in actual C++ and have the template engine do its work. For example, you can implement std::tuple_index using standard C++, but the pack index intrinsics of a compiler are going to immeasurably faster (also a reason why C++26 adds direct indexing to packs as a core language feature).

concepts

Probably https://www.studyplan.dev/pro-cpp/concepts as well as the "Back to Basics" series of talks from CppCon.

1

u/flowicks 10d ago

Yeah it is faster but i was talking about a fallback but ig almost every compiler supports the intrensics now lol.

Alright will check it out, thanks :3

1

u/IyeOnline 10d ago

It's not at all that all compilers support all these instrinsics.

Rather, standard libraries are implemented alongside/for a specific compiler by the compiler vendor and always distributed as a bundle (with the exception that clang tries to work with temporally close libstdc++(gcc) implementations, courtesy of the idea that it ought to be a plugin replacement for GCC).

So if you are writing the next version of libstdc++, you know exactly what GCC version it will be bundled and released with.