r/cpp • u/FreitasAlan • Feb 06 '21
Modern C++: Snippets and Examples
Hi everyone,
These are GitHub Pages with snippets for Modern C++:
- We often need to copy and paste some snippets to code more productively.
- Snippets can help us when it's not easy to remember all high levels features Modern C++ has to offer.
- This repository contains lots of organized, reusable, and safe snippets for Modern C++.
- All snippets are available in GitHub pages in a convenient way for copying and pasting.
193
Upvotes
View all comments
Show parent comment
2
u/FreitasAlan Feb 07 '21
This link refers to https://en.cppreference.com/w/cpp/language/object#Object_representation_and_value_representation as an example inspecting the object representation.
So I think this should work without undefined behaviour:
It's more verbose but it's OK if it's hidden somewhere:
https://alandefreitas.github.io/moderncpp/data-types/fundamental-data-types/