From 8a20796fe9156add78deda060dbc6fb0d48a4139 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 18 Jun 2024 17:14:38 -0400 Subject: [PATCH] xo-reflect: + Reflect::is_native() --- include/xo/reflect/Reflect.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/xo/reflect/Reflect.hpp b/include/xo/reflect/Reflect.hpp index e10519a..23179c1 100644 --- a/include/xo/reflect/Reflect.hpp +++ b/include/xo/reflect/Reflect.hpp @@ -227,6 +227,12 @@ namespace xo { return retval_td; } + /** true iff @p src_td is a type-description for @tparam T **/ + template + static bool is_native(TypeDescr src_td) { + return (require() == src_td); + } + /** given address @p src_address of a value with type described by @p src, * return typed pointer of type @tparam T, provided that @p src_td * actually describes @tparam T. Otherwise returns nullptr