/explore
|
You are here |
www.fluentcpp.com | ||
| | | | |
www.foonathan.net
The size of std::array is known at compile-time given the type. Yet it only provides a regular .size() member function: template struct array { constexpr std::size_t size() const { return N; } }; This is annoying if you're writing generic code that expects some sort of compile-time sized range. |
|
| | | | | ||
| | | | |
commaok.xyz
Words about Go and software |
|
| | | | | ||
| | | | |
zverovich.net
[AI summary] The author announces a new feature in the fmt C++ library that performs compile-time validation of format strings using modern constexpr support to improve code safety and usability. |
|
| | | | | ||
| | | | |
quuxplusone.github.io
We've seen previously that it's not possible to create a constexpr global variable of container type, when that container holds a pointer to a heap allocation. It's fine to create a global constexpr std::array, or even a std::string that uses only its SSO buffer; but you can't create a global constexpr std::vector or std::list (unless it's empty) because it would have to hold a pointer to a heap allocation. |
|
| | | |||