u/Clean-Upstairs-8481

C++26 Reflection Annotations: Automated Member Validation
▲ 65 r/Cplusplus+1 crossposts

C++26 Reflection Annotations: Automated Member Validation

C++26 annotations are another powerful feature that, when combined with reflection, can help us write cleaner and safer code without repeating manual validation checks for every member. In this post, I have explored how we can utilise C++26 annotations along with reflection to validate configuration parameters in a class constructor.

techfortalk.co.uk
u/Clean-Upstairs-8481 — 3 days ago
▲ 54 r/Cplusplus+1 crossposts

C++26 Reflection: Simplifying JSON Serialization

I have been exploring the new additions in C++26, and I have been discussing the reflection feature that has come with C++26. In the last post, I discussed what is reflection and how to use it and how to use it with a simple example, particularly with an enum class. Since then, there have been suggestions to provide an example which is more than a toy :). In this post, I have discussed how to use reflection for JSON serialization, which is something we often have to do. This example is somewhat taken from real-world code but has been stripped down significantly. Suggestions are always welcome.

techfortalk.co.uk
u/Clean-Upstairs-8481 — 13 days ago
▲ 81 r/Cplusplus+1 crossposts

C++26: what is reflection and how to use it

It is my ambition to explore C++26 in bits and pieces. Hopefully, by the end of this year, I will be able to explore all the major aspects of it and be in a position to evaluate which of these features to use and promote and which not to use. However, at this point, it is important to understand each and every aspect in simple terms, keeping all the clutter aside.

techfortalk.co.uk
u/Clean-Upstairs-8481 — 25 days ago
▲ 78 r/Cplusplus+1 crossposts

C++26: what is “template for”? Learning with simple example.

I have been exploring C++26 in bits and bobs and this one is about template for - a c++26 feature which I find useful. This is a short article explaining how to use this feature with the help of a simple example.

techfortalk.co.uk
u/Clean-Upstairs-8481 — 29 days ago
▲ 32 r/cpp

The new GCC 16.1 compiler is out and I couldn't wait more to try it to compile my first C++26 program. I did some faffing around and installed the GCC 16.1 on my Ubuntu machine, then put together a C++26 program much like a "Hello World" but using C++26's refection feature and it worked! Any comments welcome!

u/Clean-Upstairs-8481 — 4 months ago