gsl::not_null vs. std::reference_wrapper vs. T&

References are not pointers that cannot be null. References are semantically very different to pointers. References have value assignment and comparison semantics; that is, assignment or comparison operations involving references read and write the referenced value. Pointers have (counterintuitively) reference assignment and comparison semantics; that is, assignment or comparison operations involving pointers read and write … Read more

What’s the difference between span and array_view in the gsl library?

We talked with people in the library working group in the standards committee. They wanted the array_view they are trying to get into the standard to be read only. For the core guidelines, we needed an abstraction that was read and write. To avoid a clash between the (potential) standards and the guidelines support library … Read more

What is a “span” and when should I use one?

What is it? A span<T> is: A very lightweight abstraction of a contiguous sequence of values of type T somewhere in memory. Basically a struct { T * ptr; std::size_t length; } with a bunch of convenience methods. A non-owning type (i.e. a “reference-type” rather than a “value type”): It never allocates nor deallocates anything … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)