LB--

Results 116 comments of LB--

Thankfully we already have conditional `= delete` using `requires` clauses, so all we lost was making the syntax more terse.

@Dharmesh946 you might be interested in this video: [A Deep Dive Into C++ Object Lifetimes - Jonathan Müller - C++Now 2024](https://www.youtube.com/watch?v=oZyhq4D-QL4)

That's interesting, though it makes sense why it's done that way now that I think about it. I always find it confusing to remember the rules for when and how...

The explanation is that `std::array` does not have any constructors. The braced initializer list syntax therefore directly initializes the array elements. By contrast, `std::vector` can't do that, it must take...

I'm not sure why you need the `CATCH_AND_NEST` macro when it barely replaces any code at all, it effectively boils down to `catch(...){ std::throw_with_nested(std::runtime_error(std::format("message: {}", x))); }` which I think...

The error message says unspecified, not undefined, maybe that's an important distinction?

You might have oversimplified your actual problem. In the example you provided, your public interface should take `gsl::span` or `std::span` and you can optionally provide convenience functions for `std::array` if...

Worth noting, `const`, `&`, and `&&` apply to the `*this` object, and it makes more sense when you use the new explicit object parameter syntax. The other keywords you listed...

Moves are usually pretty cheap/fast. With a container like `std::vector` it usually just has to swap a couple pointers and sizes regardless of how many elements are contained. Just do...

> However, when using static class factory function the constructor must be public else RVO doesn't work. I'm wondering why. It's because your code isn't the one calling the constructor...