Commit Graph

8 Commits

Author SHA1 Message Date
Alex Howlett
5a84fe69d8 Improve GSL postconditions and add invariants 2018-03-08 20:17:18 -05:00
Casey Carter
95da2fd337 Don't use clang's __builtin_assume as an optimizer hint (#608)
Fixes #607.

Drive-by: use '?:' to contextually convert to bool in the fallback definition of `GSL_ASSUME`
2018-02-11 12:16:39 -08:00
Tiago
0d33bf6794 Applied iwyu --comment to the code base (#588) 2017-11-28 07:13:49 -08:00
bjude
7e529a47c2 Remove #pragma once (#545) (#570)
Core Guidelines SF.8 recommends using portable include guards instead.
2017-11-14 08:38:16 -08:00
Tiago
ebe7ebfd85 Reformat files to follow clang-format style (#492)
Project files were not following the clang-format style. For people
using IDEs were clang-format is always run after a save this would
cause unwanted changes.

This commit only applies "clang-format -i" to files.
2017-04-20 07:51:37 -07:00
Casey Carter
d65660760b fail_fast should derive from logic_error (#480)
Fixes #298.
2017-04-03 11:09:47 -07:00
Casey Carter
16a6a41690 gsl_assert changes: (#452)
* GSL_LIKELY/_UNLIKELY always contextually convert their argument to bool.

* Add macro GSL_ASSUME(cond) to inform the optimizer that the predicate cond must hold.

* Reimplement Expects & Ensures as expressions for flexibility and correctness. (Think about "if (cond1) Expects(cond2); else goto fail;")

* Expects and Ensures GSL_ASSUME their predicate when GSL_UNENFORCED_ON_CONTRACT_VIOLATION is defined.
2017-03-20 09:30:14 -07:00
Casey Carter
4e8f95b418 Cleanup include structure, constexpr and noexcept compiler workarounds.
* Nest "gsl" directory inside a new "include" directory.

* Cleanup the _MSC_VER conditionals a bit; use constexpr on VS2017+.

* Don't #define noexcept on non-Microsoft implementations.

* Workaround VS2017 bug in multi_span. (Also implement == and != for static_bounds_dynamic_range_t because I'm an EoP semantic soundness snob.)

Fixes #441.
2017-02-07 15:59:37 -08:00