/explore

Click through on any links that interest you or select the planets on the right to continue exploring the Outer Web.
You are here

eyakubovich.github.io
| | www.think-cell.com

[AI summary] This post explores a C++ idiom using static constexpr and std::integral_constant to provide compile-time size information for std::array.
3.8 parsecs

Travel
| |
| | www.cppstories.com

For C++17 everyone wanted to have concepts, and as you know, we didn't get them. But does it mean C++17 doesn't improve templates/template meta-programming? Far from that! In my opinion, we get excellent features. Read more for details. Intro Do you work a lot with templates and meta-programming? With C++17 we get a few nice improvements: some are quite small, but also there are notable features as well!
4.6 parsecs

Travel
| |
| | 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.
3.9 parsecs

Travel
| |
| | www.cppstories.com

Variadic Templates from C++11 is probably not a feature that you use on a daily basis. But recently, I've come across one refactoring example where I've decided to give a try and apply variadics. Intro When I was doing some work in some old UI code I've noticed several similar lines of code that looked like that:
19.3 parsecs

Travel
|