kokkos-execution 0.0.1
Loading...
Searching...
No Matches
test_reflection.cpp
Go to the documentation of this file.
1#include <concepts>
2#include <meta>
3#include <string_view>
4
5#include "gtest/gtest.h"
6
17
18namespace Tests::Std {
19
20template <typename T>
21struct MyType { };
22
24consteval bool test_display_string_of() {
25 constexpr auto str_of = std::meta::display_string_of(^^MyType<int>);
26
27 static_assert(std::same_as<decltype(str_of), const std::string_view>);
28
29 static_assert(str_of == "Tests::Std::MyType<int>");
30
31 return true;
32}
33
34static_assert(test_display_string_of());
35
37TEST(ReflectionTest, display_string_of) {
38 std::cout << std::meta::display_string_of(^^MyType<int>) << std::endl;
39}
40
41} // namespace Tests::Std
consteval bool test_display_string_of()