/r/cpp

Photograph via snooOG

Discussions, articles and news about the C++ programming language or programming in C++.

Discussions, articles, and news about the C++ programming language or programming in C++.

For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.


Get Started

The C++ Standard Home has a nice getting started page.

Videos

The C++ standard committee's education study group has a nice list of recommended videos.

Reference

cppreference.com

Books

There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.


Show all links

Filter out CppCon links

Show only CppCon links

/r/cpp

298,586 Subscribers

0

No Talk from Bjarne?

Why is Dr. Stroustrup not giving the opening keynote in Cppcon24?

1 Comment
2024/11/11
20:44 UTC

8

AVX and NEON vectorization workshops

Hi!

I am Ivica, I am the guy working for Johnny's Software Lab (johnnysswlab.com) - web site and one man company that specializes in software performance. A few times I saw posts from my web site in this subreddit, that means at least some people find this topic interesting.

I know people don't like sales pitches, but this is exactly what it is, admins please forgive me.

For all software developers who want to speed up their software, I created two vectorization workshops, one which deals with AVX on Intel and AMD CPUs and the other for NEON on ARM CPUs. They are two days long, and cover programming using compiler intrinsics. No knowledge of vectorization is required, but you do need to grasp basic concepts of C and C++ (loops, functions, arrays, bit manipulation).

We had a pilot AVX workshop two weeks ago, and the feedback was very good: the workshop is interesting, challenging but not too difficult and teaches useful things you can immediately use to speed up your software.

The workshop consists of lectures and exercises and we go from essentially no knowledge to everything you need to know about vectorization in two days.

If you are interested in learning about vector programming, you can learn more info about it here, including topics that we will cover, available dates and prices.

https://johnnysswlab.com/avx-neon-vectorization-workshop/

Thank you for your attention and have a good day!

Ivica

7 Comments
2024/11/11
20:19 UTC

2

Guidance needed: New graduate in CS. Struggling to figure out how to enter the compilers field

Hello everyone. How are you doing? I have recently obtained my bachelor's degree in Computer Engineering and since I took the compilers course at college I figured out that was the area I'd like to work in. However, I've been struggling to find new grad positions for the field. It seems most of them require a masters degree or a PhD, which I am not sure I'd like to go through.

I'd like to know if anyone here went through the same thing as me and what steps should I follow to achieve this. I have read in some articles that doing contributions to popular repos like LLVM, MLIR, etc, would make one be in the radar of recruiters, however I am not sure how true this statement is. I wanted to work in these two repos and projects.

Personally, I was thinking about doing related projects in the area using these technologies, however I am not sure what kind of project you make me stand out.

My undergradraduate thesis, for example, was a tree-walk interpreter for a dynamically typed language based on Lox but with many more features, so I think that is at least something.

In the jobs announcements that I've seen, knowledge about PyTorch, JAX, ONNX, CUDA is sometimes also required, but, to be honest, I am not sure how far should I go into this. If anyone has some advice about it, I'd like to hear.

Lastly, this is probably an important factor to mention, but I would need visa support since I live in Brazil. Do companies in this areas provide this kind of support or am I just doomed?

Thanks in advance.

15 Comments
2024/11/11
18:44 UTC

3

C++ (OPEN SOURCE) Beldum Package Manager & C++ Backend Web Server

Hello my fellow colleagues. I hope everyone is having a great start to their Monday's.

This is my first post on r/cpp, and I've been waiting to release this publicly until I felt it was ready for use / contributions.

I've created 2 open sourced projects

1) The Beldum Package Manger:

https://github.com/Nord-Tech-Systems-LLC/beldum_package_manager

2) A C++ Backend Webserver (under construction, but working enough to play around with):

https://github.com/Nord-Tech-Systems-LLC/cpp_webserver

Prior to responses on this thread I would like to address a few things that I know are going to be commented on, so here is a bit of a FAQ:

  1. Why not use the other package managers such as `Vcpkg` or `Conan`?

I understand the learning curve associated with learning C++, and it seems like the package managers associated with C++ do not provide a simple way to practice and test simple C++ libraries. There are usually difficult or cumbersome processes associated with trying to test a package, and a deep understanding of linux directory structures.

What I've done is taken a complex task such as installing a library and made it similar to that of `npm` or `yarn`, where all of the details of how the package is handled is abstracted for new users.

  1. Where is your benchmarking?

In today's world, we all want the fastest product -- I get it; this is not meant to be the fastest library on the market, nor is it striving to be. It is for new users to test and learn C++ so they are not discouraged away from learning C++. I feel C++ is quickly losing it's userbase. This is my attempt at trying to revitalize the language for our new users today.

  1. Why not use Rust or another language?

C++ is a great language. I understand that a lot of people have issues with the language itself that are deep rooted in decades of programming, but there is a large set of infrastructure that is built on the C and C++ languages. C++ is powerful, and I know there are lots of innovative C++ programmers (new and old) who have the capabilities to help drive C++ into the future.

  1. Statement, not question: But you still have to learn CMake.

Beldum package manager provides a template of how you would import the libraries, giving the new users a chance to see how it should work, with a predefined build script that they can mess around with, to make learning CMake not as difficult or such a high learning curve.

Please, can we have this discussion be productive and constructive?

Lastly,

It's nice to meet the C++ community. I hope to make future contributions as well.

C++ is my chosen career language.

Thank you,

VikingOfValhalla

1 Comment
2024/11/11
18:17 UTC

0

Polymorphic Enums?

Say I want to keep network packet size low, is there some way to make polymorphic enums?

Or should I just be inefficient as possible and send full strings and entire files over the network?

11 Comments
2024/11/11
14:54 UTC

272

Herb Sutter leaves Microsoft for Citadel

142 Comments
2024/11/11
14:38 UTC

0

threat to c++?

There seems to be so much buzz about c++ not being promoted by US govt. can this be a threat. I am very new to c++ development. confused about career option a bit. Any suggestions?
https://www.techrepublic.com/article/cisa-fbi-memory-safety-recommendations/

58 Comments
2024/11/11
09:45 UTC

23

What do you consider your best practices for including third party libraries?

I’m including multiple third party libraries in my code, but when it comes to project organization—beyond not including in multiple parts of the code— I’m not as skilled. Sometimes I might include a library for front end graphics, or for encryption or networking, but then I find that I get errors popping up which indicate that I can’t integrate those libraries because they don’t implement native c++ types.

I’m just curious what people consider good/best practices for including multiple libraries . Do you create handlers for different types? Is there a method/std function for changing native types into those compatible with third party libraries? If you have any projects you’re working on where you can give examples of your project structure I’d love to see and hear what your approach would be.

63 Comments
2024/11/09
07:41 UTC

0

How does new cpp reflection work?

Can I say.. reflect on a void pointer returning members and then my execute a method on that pointer? Will I ever be able to?

16 Comments
2024/11/08
12:24 UTC

86

Why is there still no networking module in the C++ STL?

172 Comments
2024/11/08
09:44 UTC

1

Rad debugger

I found on github this project: https://github.com/EpicGamesExt/raddebugger. It is a debugger for C++ in windows. Someone knows it? What do you think about that? Can really replace the visual studio debugger?

15 Comments
2024/11/08
02:11 UTC

0

7 Tips you can do today to instantly increase the security of your C++ application

25 Comments
2024/11/08
01:27 UTC

14

KDE Stack training

0 Comments
2024/11/07
19:40 UTC

5

Article on detecting file descriptor errors with Valgrind

3 Comments
2024/11/07
12:53 UTC

11

C++ Show and Tell - November 2024

Use this thread to share anything you've written in C++. This includes:

  • a tool you've written
  • a game you've been working on
  • your first non-trivial C++ program

The rules of this thread are very straight forward:

  • The project must involve C++ in some way.
  • It must be something you (alone or with others) have done.
  • Please share a link, if applicable.
  • Please post images, if applicable.

If you're working on a C++ library, you can also share new releases or major updates in a dedicated post as before. The line we're drawing is between "written in C++" and "useful for C++ programmers specifically". If you're writing a C++ library or tool for C++ developers, that's something C++ programmers can use and is on-topic for a main submission. It's different if you're just using C++ to implement a generic program that isn't specifically about C++: you're free to share it here, but it wouldn't quite fit as a standalone post.

Last month's thread: https://www.reddit.com/r/cpp/comments/1ftoxnh/c_show_and_tell_october_2024/

22 Comments
2024/11/07
10:33 UTC

55

Is there a Visual Studio blog about C++ features and releases?

I used to have the Visual Studio Blog and C++ Team Blog in my RSS feed. In the past year or two, it's been flooded with marketing, Copilot and Unreal stuff, with very few news about C++ features or standard library changes. I swear I used to get articles about new previews, changelogs from the standard library, etc.

Is there another blog on the Microsoft website, or is it just gone?

9 Comments
2024/11/06
16:58 UTC

45

If some form of reflection gets into C++26, how far will we be from having something like serde in C++?

20 Comments
2024/11/06
15:48 UTC

27

Building a Custom C++ Serializer for Efficient Data Handling

I just published a blog post that might interest those of you working with data-heavy applications or game engines. Over the past few months, I’ve been developing a custom C++ serializer tailored for handling complex game components and making the serialization process more efficient and readable.

The post dives into:

  • Core Design & Structure: How the serializer is built to handle both basic and custom types.
  • Custom Data Types: Examples of handling types like Vector2D, Vector3D, and ModelInfo.
  • Add User Data Types: Examples of how to expand the serializer with user defined data types

Check it out here: Building a Custom C++ Serializer for Efficient Data Handling

Would love any feedback or thoughts! And if you’re interested in serialization or working on similar projects, let’s connect!

4 Comments
2024/11/06
01:54 UTC

Back To Top