/******************************************************************************* * This file is part of the "https://github.com/blackmatov/meta.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md * Copyright (C) 2021-2023, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include #include namespace { int int_func() { return 0; } } TEST_CASE("meta/meta_issues/random/3") { namespace meta = meta_hpp; static_assert(std::is_same_v()), meta_hpp::function_type>); static_assert(std::is_same_v()), meta_hpp::pointer_type>); static_assert(std::is_same_v()), meta_hpp::reference_type>); static_assert(std::is_same_v); static_assert(std::is_same_v); CHECK(meta::resolve_type().get_kind() == meta::type_kind::function_); CHECK(meta::resolve_type().get_kind() == meta::type_kind::pointer_); CHECK(meta::resolve_type().get_kind() == meta::type_kind::reference_); CHECK(meta::resolve_type(int_func).get_kind() == meta::type_kind::function_); CHECK(meta::resolve_type(&int_func).get_kind() == meta::type_kind::pointer_); CHECK(meta::resolve_type().get_data_type() == meta::resolve_type()); CHECK(meta::resolve_type().get_data_type() == meta::resolve_type()); { meta::uvalue v{&int_func}; CHECK_FALSE(v.has_deref_op()); CHECK(v.get_type() == meta::resolve_type()); CHECK((v.as() == &int_func)); } }