Andrew

Results comments of Andrew

An alternative pattern that I've come to love is what some people call an "Impl pattern". The basic idea is that you declare a dummy "Impl" class in the scope...

No, the suggested wording doesn't rule this pattern out. However, I agree with Mike in that this note seems a bit too situational to be included in the guideline. I...

> I can't write a test which guarantees that no future method added to Wheel won't mutate m_radius. I'd argue you shouldn't write such a test at all. What you...

@shaneasd > Logically, as it's a fixed capacity vector, I may want to make the capacity const. If it's a fixed capacity **non-copy assignable and non-move assignable** vector then I...

Herb mentions `gsl::not_null`. I believe Core Guidelines recommends using `(const) T&` for functions and `gsl::not_null` for classes when you need to pass mocks/dependencies, etc. At least that's how I approach...

@marbub `T&` and `gsl::not_null` are equivalent with the exception of `gsl::not_null` being reassignable (and thus not preventing the class from being copy/move-assignable). Both are non-owning according to R.3, R.4. I...

GSL is not part of the standard. However, my point still stands. `T&` is non-null, non-reassignable, `T*` maybe-null, reassignable. `gsl::not_null` bridges the gap between the two, serving as a hybrid...

@shaneasd It might not be a correct way to copy this type, I agree. But my point is that you've got to have a mighty good reason to make your...

@marbub > what about resources like a database connection I would expect a database connection to be non-copyable but still **movable**. And it seems whoever wrote this C++ wrapper for...

You've made Database non-movable so I don't see what could go wrong. However, comparing your Database class with the one I linked earlier - I'd prefer the latter because if,...