Questions tagged [ms-gsl]

For questions related to Microsoft GSL - C++ Guidelines Support Library

Questions, related to use Microsoft C++ Guidelines Support Library, and, more general, to C++ Core Guidelines

Link to Library: https://github.com/Microsoft/GSL

3 questions
6
votes
2 answers

What is "template using owner = T;"?

Below is excerpted from gsl.h of Microsoft's gsl library (https://github.com/microsoft/gsl): namespace gsl { // // GSL.owner: ownership pointers // using std::unique_ptr; using std::shared_ptr; template using…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
2
votes
1 answer

Doesn't gsl::cstring_span support constexpr? If not, why should I use it?

I have a piece of code that looks like this: constexpr gsl::cstring_span<> const somestring{"Hello, I am a string"}; and it refuses to compile with a message complaining that some non-constexpr function is being called somewhere. Why is this? This…
Omnifarious
  • 54,333
  • 19
  • 131
  • 194
0
votes
1 answer

Error Handling with Core Guidelines GSL Expects, Ensures, and narrow_cast

I am trying to follow the Cpp Core Guidelines and use GSL where appropriate. In particular, I would like to use Expects and Ensures for pre and post-conditions, as well as span, and narrow_cast, but the error handling is not robust and does not…
Phil
  • 5,822
  • 2
  • 31
  • 60