Comments (6)
I would not label an issue as resolved when in reality it has been rejected.
from gsl.
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.
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.
Fair enough. Fixed.
from gsl.
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.
- It is a macro so it can collect file/line information as helpful diagnostics when failures occur.
- 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)
- How to indicate that memory management moved to parent (like in Qt QObject) HOT 7
- final_action has an unused class member HOT 2
- Conversion from span<dynamic_extent> to span<N> failes HOT 1
- gsl::narrow and NaN
- compilation errors around string_span HOT 2
- Doxygen documentation HOT 5
- Wrong Expects in gsl::at? HOT 5
- About release 4.0.0 HOT 2
- [cmake] GSL.natvis issues HOT 3
- ❓ Please take the GSL GitHub survey HOT 1
- Question: How to print a gsl::byte? HOT 2
- How to use the smartpointer overloads inside `<span_ext>`? HOT 1
- Purpose of `<span_ext>`
- gsl::not_null at compile time HOT 13
- Provide a "safe" and "simple" way for binary I/O HOT 2
- Type mismatch in span::operator[] HOT 4
- gsl.pc and gsl/gsl_rng.h files not found HOT 2
- CMake Error at CMakeLists.txt:14 (find_package): Could not find a package configuration file provided by "Microsoft.GSL" HOT 2
- Missing `swap` for `gsl::not_null` for move-only types HOT 4
- `GSL_SUPPRESS(y)` expands to `[[gsl::suppress("x")]]` for clang HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gsl.