<commit_before>/**
 * This file defines facilities to perform concept-based overloading.
 */

#ifndef DUCK_SANDBOX_CONCEPT_OVERLOAD_HPP
#define DUCK_SANDBOX_CONCEPT_OVERLOAD_HPP

#include <duck/detail/mpl_extensions.hpp>

#include <boost/mpl/and.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/back.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/mpl/copy_if.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/find_if.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/pop_back.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/mpl/quote.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/utility/enable_if.hpp>


namespace duck {

// Note to self: Storing the visited concepts in a list ordered by concept
//               specificity could make things much more efficient.

/**
 * Tag to signal the failure of a concept-based overload resolution.
 *
 * @note It is important that this stays an incomplete type.
 */
struct concept_based_overload_resolution_failed;

//! Compile-time data structure storing state during an overload resolution.
template <typename Family, typename VisitedConcepts = boost::mpl::vector<> >
struct overload_resolution {
    typedef VisitedConcepts visited_concepts;
    typedef Family family;

    typedef overload_resolution type; // to make it a metafunction
};

//! Metafunction returning whether a `Type` is a model of a given `Concept`.<commit_msg>Transform a compile-time error into a link-time error on GCC until it accepts incomplete types in decltype.<commit_after>/**
 * This file defines facilities to perform concept-based overloading.
 */

#ifndef DUCK_SANDBOX_CONCEPT_OVERLOAD_HPP
#define DUCK_SANDBOX_CONCEPT_OVERLOAD_HPP

#include <duck/detail/mpl_extensions.hpp>

#include <boost/config.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/back.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/mpl/copy_if.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/find_if.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/pop_back.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/mpl/quote.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/utility/enable_if.hpp>


namespace duck {

// Note to self: Storing the visited concepts in a list ordered by concept
//               specificity could make things much more efficient.

/**
 * Tag to signal the failure of a concept-based overload resolution.
 *
 * @note It is important that this stays an incomplete type.
 */
struct concept_based_overload_resolution_failed
#if defined(BOOST_NO_CXX11_DECLTYPE_N3276)
{
    // On GCC, incomplete types can't appear inside decltype.
    // Instead of failing on valid decltypes, we will trigger a link time
    // error when `concept_based_overload_resolution_failed` is used.
    ~concept_based_overload_resolution_failed();
}
#endif
;

//! Compile-time data structure storing state during an overload resolution.
template <typename Family, typename VisitedConcepts = boost::mpl::vector<> >
struct overload_resolution {
    typedef VisitedConcepts visited_concepts;
    typedef Family family;

    typedef overload_resolution type; // to make it a metafunction
};

//! Metafunction returning whether a `Type` is a model of a given `Concept`.
{'fraction_non_alphanumeric': 0.10545556805399325, 'fraction_numerical': 0.001687289088863892, 'mean_word_length': 4.6912, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, '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': '5438525', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1090, 'n_words': 318}