kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
test_constexpr_exception.cpp
Go to the documentation of this file.
1
#include <stdexcept>
2
14
15
#if !defined(__cpp_constexpr_exceptions)
16
# error "C++ constexpr exception is required for this test."
17
#endif
18
19
namespace
Tests::Std
{
20
22
consteval
void
throw_invalid_argument
() {
23
throw
std::invalid_argument{
"message"
};
24
}
25
27
consteval
bool
test_catch_exception
() {
28
try
{
29
throw_invalid_argument
();
30
return
false
;
31
}
catch
(
const
std::invalid_argument& iarg) {
32
return
std::string_view{iarg.what()} ==
"message"
;
33
}
34
}
35
36
static_assert
(
test_catch_exception
());
37
38
}
// namespace Tests::Std
Tests::Std
Definition
test_constexpr_exception.cpp:19
Tests::Std::throw_invalid_argument
consteval void throw_invalid_argument()
Unconditionally throw a std::invalid_argument exception.
Definition
test_constexpr_exception.cpp:22
Tests::Std::test_catch_exception
consteval bool test_catch_exception()
Definition
test_constexpr_exception.cpp:27
tests
std
test_constexpr_exception.cpp
Generated on
for kokkos-execution by
1.18.0