<commit_before>#pragma once

#include "reflect.h"

#include <utils/utils.h>

namespace reflection {

template<typename T>
using name = typename T::asdf;

namespace detail {

template<typename Reflection, typename F>
using detect_is_member_type = typename Reflection::template detect_is_member_type<F>;

template<class Reflection, typename F>
constexpr static auto is_member_type()
{
    return utils::is_detected_v<detect_is_member_type, Reflection, F>;
}

template<class Reflection>
constexpr static auto is_member_function()
{
    //! Member-functions currently cannot be detected (yet).
    //! However, that is not a problem, because they will be SFINAE'ed away,
    //! in case the reflected entity wasn't a member-function.
    // TODO: It might still be an annoyance for IDEs, though, where it could show
    //       the candidate member-functions, even though none exists.
    return utils::always_true<Reflection>;
}

} // namespace detail

template<typename T>
constexpr static auto reify(Reflection<T>) -> T;

template<class Reflection, typename F>
constexpr static auto reify(Reflection refl, F)
{
    // using X = name<Reflection>;
    // using X = name<F>;

    // TODO: Shouldn't we be passing the class instead of F?
    if constexpr (detail::is_member_type<Reflection, F>())
    {
        return typename Reflection::template reflect_member_type<F>{};
    }
    else if constexpr (detail::is_member_function<Reflection>())
    {

        return typename Reflection::template reflect_member_function<F>{};
    }
}

} // namespace reflection<commit_msg>Removed some obsolete out-commented code.<commit_after>#pragma once

#include "reflect.h"

#include <utils/utils.h>

namespace reflection {

namespace detail {

template<typename Reflection, typename F>
using detect_is_member_type = typename Reflection::template detect_is_member_type<F>;

template<class Reflection, typename F>
constexpr static auto is_member_type()
{
    return utils::is_detected_v<detect_is_member_type, Reflection, F>;
}

template<class Reflection>
constexpr static auto is_member_function()
{
    //! Member-functions currently cannot be detected (yet).
    //! However, that is not a problem, because they will be SFINAE'ed away,
    //! in case the reflected entity wasn't a member-function.
    // TODO: It might still be an annoyance for IDEs, though, where it could show
    //       the candidate member-functions, even though none exists.
    return utils::always_true<Reflection>;
}

} // namespace detail

template<typename T>
constexpr static auto reify(Reflection<T>) -> T;

template<class Reflection, typename F>
constexpr static auto reify(Reflection refl, F)
{
    // TODO: Shouldn't we be passing the class instead of F?
    if constexpr (detail::is_member_type<Reflection, F>())
    {
        return typename Reflection::template reflect_member_type<F>{};
    }
    else if constexpr (detail::is_member_function<Reflection>())
    {
        return typename Reflection::template reflect_member_function<F>{};
    }
}

} // namespace reflection
{'fraction_non_alphanumeric': 0.09967213114754099, 'fraction_numerical': 0.0, 'mean_word_length': 4.251290877796902, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4855874', 'n_tokens_mistral': 894, 'n_tokens_neox': 867, 'n_words': 283}