Revision d846fe50a3f0bb7767c7e087a05f4be95f4da0ec authored by Anna Gringauze on 15 March 2018, 23:00:08 UTC, committed by GitHub on 15 March 2018, 23:00:08 UTC
* Enable usage of gsl::narrow with exceptions disabled

This solution uses the approach of boost::asio to enabling usage of the
library in environments where exception usage is either prohibited
or not feasible (due to code size constraints). A function template
gsl::throw_exception has been added, which in a normal environment just
throws the exception. However, when GSL_TERMINATE_ON_CONTRACT_VIOLATION
is defined the function is only declared by gsl and the definition of
this function template must be supplied by the library's user.

Closes: #468

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>

Addition:
- understand STL no exception macro
- use function static variable to set termination handler in kernel mode
- add compile-only tests for no-exception mode

* added termination tests and fixed bugs

* disabled warning C4577 for msvc 2015
1 parent c6bf25a
History
File Mode Size
include
tests
.clang-format -rw-r--r-- 530 bytes
.gitignore -rw-r--r-- 177 bytes
.travis.yml -rw-r--r-- 7.2 KB
CMakeLists.txt -rw-r--r-- 2.2 KB
CONTRIBUTING.md -rw-r--r-- 2.0 KB
GSL.natvis -rw-r--r-- 3.6 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 4.6 KB
ThirdPartyNotices.txt -rw-r--r-- 1.9 KB
appveyor.yml -rw-r--r-- 1003 bytes

README.md

back to top