Giter VIP home page Giter VIP logo

Comments (6)

viboes avatar viboes commented on May 20, 2024 1

I would not label an issue as resolved when in reality it has been rejected.

from gsl.

gdr-at-ms avatar gdr-at-ms commented on May 20, 2024

The Expects() and Ensures() come from the guidelines. Ideally, we should have language support for them in form of contracts (see my CppCon talk). In the meantime, the fact that they are macros is an implementation detail, and should not be exposed as al uppercase letters.

from gsl.

viboes avatar viboes commented on May 20, 2024

Do you mean that C++17/20 will have Expects and Ensures as keywords?
Introducing these macros prevents a user having such names in their application to use GSL, which is bad IMHO.

But why do you use a macro when an inline function is enough? It is so hard to read

gsl::expects(x);
gsl::ensures(x);

?

from gsl.

neilmacintosh avatar neilmacintosh commented on May 20, 2024

Fair enough. Fixed.

from gsl.

robindegen avatar robindegen commented on May 20, 2024

I agree with @viboes here. I have 2 questions; 1. why is it a macro and 2. why does it not follow the coding standard of the rest of the library with regards to capitalization?

from gsl.

neilmacintosh avatar neilmacintosh commented on May 20, 2024
  1. It is a macro so it can collect file/line information as helpful diagnostics when failures occur.
  2. The capitalization follows the name suggested by the Core Guidelines. To be honest, that is something that does not particularly bother me either way. There is a standardization proposal to add a contract system to C++. That does use different capitalization so maybe it will change in time.

from gsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.