Files
libicsneo/include/icsneo/third-party/optional-lite/example/05-no-exceptions.cpp
T
Paul Hollinsky 6c1cbc9db8 Optional: Move optional-lite to the include/third-party directory
This fixes the use case of adding the include folder
manually to an outside project.
2021-04-23 20:01:53 -04:00

14 lines
311 B
C++

#include "nonstd/optional.hpp"
using nonstd::optional;
int main()
{
optional<int> v;
v.value(); // asserts (normally throws)
}
// cl -nologo -I../include 05-no-exceptions.cpp && 05-no-exceptions
// g++ -Wall -fno-exceptions -I../include -o 05-no-exceptions 05-no-exceptions.cpp && 05-no-exceptions