<commit_before>#ifndef STINGRAY_TOOLKIT_BIND_H
#define STINGRAY_TOOLKIT_BIND_H


#include <stingray/toolkit/function.h>
#include <stingray/toolkit/FunctorInvoker.h>
#include <stingray/toolkit/Macro.h>
#include <stingray/toolkit/MetaProgramming.h>
#include <stingray/toolkit/reference.h>
#include <stingray/toolkit/shared_ptr.h>
#include <stingray/toolkit/Tuple.h>
#include <stingray/toolkit/TypeList.h>


namespace stingray
{

	/**
	 * @addtogroup toolkit_functions
	 * @{
	 */

#define TY typename

	template < size_t N > struct BindPlaceholder
	{ static const size_t Index = N; };

	static inline BindPlaceholder<0>	_1()	{ return BindPlaceholder<0>(); }
	static inline BindPlaceholder<1>	_2()	{ return BindPlaceholder<1>(); }
	static inline BindPlaceholder<2>	_3()	{ return BindPlaceholder<2>(); }
	static inline BindPlaceholder<3>	_4()	{ return BindPlaceholder<3>(); }
	static inline BindPlaceholder<4>	_5()	{ return BindPlaceholder<4>(); }
	static inline BindPlaceholder<5>	_6()	{ return BindPlaceholder<5>(); }
	static inline BindPlaceholder<6>	_7()	{ return BindPlaceholder<6>(); }
	static inline BindPlaceholder<7>	_8()	{ return BindPlaceholder<7>(); }
	static inline BindPlaceholder<8>	_9()	{ return BindPlaceholder<8>(); }
	static inline BindPlaceholder<9>	_10()	{ return BindPlaceholder<9>(); }

	namespace Detail
	{
		template < size_t N > struct Chomper
		{ static const size_t Index = N; };

		template < typename T > struct IsPlaceholder							{ static const bool Value = false; };
		template < size_t N > struct IsPlaceholder<BindPlaceholder<N>(*)() >	{ static const bool Value = true; };
		template < size_t N > struct IsPlaceholder<Chomper<N> >					{ static const bool Value = true; };


		template < typename T >
		struct GetPlaceholderIndex
		{ static const int Value = -1; };

		template < size_t N >
		struct GetPlaceholderIndex<BindPlaceholder<N>(*)() >
		{ static const int Value = N; };

		template < size_t N >
		struct GetPlaceholderIndex<Chomper<N> >
		{ static const int Value = N; };<commit_msg>Wow! Much bind! So placeholders!<commit_after>#ifndef STINGRAY_TOOLKIT_BIND_H
#define STINGRAY_TOOLKIT_BIND_H


#include <stingray/toolkit/function.h>
#include <stingray/toolkit/FunctorInvoker.h>
#include <stingray/toolkit/Macro.h>
#include <stingray/toolkit/MetaProgramming.h>
#include <stingray/toolkit/reference.h>
#include <stingray/toolkit/shared_ptr.h>
#include <stingray/toolkit/Tuple.h>
#include <stingray/toolkit/TypeList.h>


namespace stingray
{

	/**
	 * @addtogroup toolkit_functions
	 * @{
	 */

#define TY typename

	template < size_t N > struct BindPlaceholder
	{ static const size_t Index = N; };

#define DETAIL_TOOLKIT_DECLARE_PLACEHOLDER(Index_, UserArg_) \
	static inline BindPlaceholder<Index_>	TOOLKIT_CAT(_, TOOLKIT_INC(Index_))()	{ return BindPlaceholder<Index_>(); }

	TOOLKIT_REPEAT(20, DETAIL_TOOLKIT_DECLARE_PLACEHOLDER, ~)

#undef DETAIL_TOOLKIT_DECLARE_PLACEHOLDER

	namespace Detail
	{
		template < size_t N > struct Chomper
		{ static const size_t Index = N; };

		template < typename T > struct IsPlaceholder							{ static const bool Value = false; };
		template < size_t N > struct IsPlaceholder<BindPlaceholder<N>(*)() >	{ static const bool Value = true; };
		template < size_t N > struct IsPlaceholder<Chomper<N> >					{ static const bool Value = true; };


		template < typename T >
		struct GetPlaceholderIndex
		{ static const int Value = -1; };

		template < size_t N >
		struct GetPlaceholderIndex<BindPlaceholder<N>(*)() >
		{ static const int Value = N; };

		template < size_t N >
		struct GetPlaceholderIndex<Chomper<N> >
		{ static const int Value = N; };
{'fraction_non_alphanumeric': 0.12076095947063689, 'fraction_numerical': 0.00964984835952578, 'mean_word_length': 4.8896103896103895, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 73, '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': '541118', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1278, 'n_words': 296}