Should we be using GSL?

Hi all,

So, I noticed that we use very little of the Guidelines Support Library. I’d like to gather opinions on replacing gsl::index with our own index typedef defined in OpenMC’s namespace, replacing Expects with assert, and replacing gsl::span with our own implementation, which should be very short and only covering the narrow range of functionality we use.

In fact, from what I can tell, we could just pass vectors by reference rather than use spans at all, since we don’t seem to restrict spans to subsets of vectors anywhere in the codebase. So we probably don’t even need to implement a span.


Hi @gridley. I know there ended up being some robust discussion on this as part of one pull request. I don’t see a strong incentive at present to get rid of GSL but I’m open to it. Expects is not exactly the same as assert with respect to behavior under different build configurations. For span, we will eventually be able to just use std::span since it is part of C++20. Note that there are a few cases where we convert pointer/length pairs to span (used as part of our C API).