Skip to content

Commit

Permalink
known issue: crtp
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackMATov committed Feb 15, 2024
1 parent 245f784 commit c643188
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
6 changes: 3 additions & 3 deletions develop/singles/headers/meta.hpp/meta_all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4772,15 +4772,15 @@ namespace meta_hpp
}

template < typename T >
[[nodiscard]] auto resolve_type() {
auto resolve_type() {
using namespace detail;
type_registry& registry = type_registry::instance();
return registry.resolve_by_type<std::remove_cv_t<T>>();
}

template < typename T >
// NOLINTNEXTLINE(*-missing-std-forward)
[[nodiscard]] auto resolve_type(T&& from) {
auto resolve_type(T&& from) {
using namespace detail;

using raw_type = std::remove_cvref_t<T>;
Expand Down Expand Up @@ -4809,7 +4809,7 @@ namespace meta_hpp
registry.for_each_scope(std::forward<F>(f));
}

[[nodiscard]] inline scope resolve_scope(std::string_view name) {
inline scope resolve_scope(std::string_view name) {
using namespace detail;
state_registry& registry = state_registry::instance();
return registry.resolve_scope(name);
Expand Down
24 changes: 24 additions & 0 deletions develop/untests/known_issues/crtp_recursion.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*******************************************************************************
* 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-2024, by Matvey Cherevko (blackmatov@gmail.com)
******************************************************************************/

#include <meta.hpp/meta_all.hpp>
#include <doctest/doctest.h>

namespace
{
template < typename Derived >
struct base {};

struct derived : base<derived> {
META_HPP_ENABLE_BASE_INFO(base<derived>)
};
}

TEST_CASE("meta/meta_issues/random/9") {
namespace meta = meta_hpp;

// meta::resolve_type<derived>();
}

0 comments on commit c643188

Please sign in to comment.