Get the latest tech news

Things C++26 define_static_array can't do


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.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of things

things

Related news:

News photo

I built "Middle Class Museum", a tour of things that used to be affordable

News photo

Importing a Chinese Phone? Here are six things you need to know

News photo

The West forgot how to make things, now it’s forgetting how to code