<commit_before>#ifndef __GS_DVRLIB_TOOLKIT_NESTEDTYPECHECK_H__
#define __GS_DVRLIB_TOOLKIT_NESTEDTYPECHECK_H__


#include <stingray/toolkit/TypeList.h>

namespace stingray
{

	namespace Detail
	{
		struct DoesNotHaveAnyNestedTypes
		{ static const bool Value = false; };
	}

#define TOOLKIT_DECLARE_NESTED_TYPE_CHECK(NestedType_) \
	template < typename T > \
	struct HasNestedType_##NestedType_ \
	{ \
		template < typename Type > \
		class Impl \
		{ \
			struct BaseMixin { struct NestedType_{}; }; \
			struct Base : public Type, public BaseMixin { Base(); }; \
			\
			template <typename V, V t>    class Helper{}; \
			\
			template <typename U> static NoType deduce(U*, typename U::NestedType_* = 0); \
			static YesType deduce(...); \
			\
		public: \
			static const bool Value = (sizeof(YesType) == sizeof(deduce((Base*)(0)))); \
		};\
		static const bool Value = \
			If	< \
					IsClass<T>::Value, \
					Impl<T>, \
					stingray::Detail::DoesNotHaveAnyNestedTypes \
				>::ValueT::Value; \
	}

#define TOOLKIT_DECLARE_METHOD_CHECK(Method_) \
	template < typename T > \
	struct HasMethod_##Method_ \
	{ \
		template <typename Type> \
		class Impl \
		{ \
			struct BaseMixin { void Method_(){} }; \
			struct Base : public Type, public BaseMixin { Base(); }; \
			\
			template <typename V, V t>    class Helper{}; \
			\
			template <typename U> static NoType deduce(U*, Helper<void (BaseMixin::*)(), &U::Method_>* = 0); \
			static YesType deduce(...); \
			\
		public: \
			static const bool Value = (sizeof(YesType) == sizeof(deduce((Base*)(0)))); \
		}; \
		static const bool Value = \
			If	< \
					IsClass<T>::Value, \
					Impl<T>, \
					stingray::Detail::DoesNotHaveAnyNestedTypes \
				>::ValueT::Value; \
	}

}


#endif
<commit_msg>rewrited HasNestedType<commit_after>#ifndef STINGRAY_TOOLKIT_NESTEDTYPECHECK_H
#define STINGRAY_TOOLKIT_NESTEDTYPECHECK_H


#include <stingray/toolkit/MetaProgramming.h>


namespace stingray
{

#define TOOLKIT_DECLARE_NESTED_TYPE_CHECK(NestedType_) \
	template < typename T > \
	class HasNestedType_##NestedType_ \
	{ \
		template < typename U > static YesType deduce(IntToType<sizeof(typename U::NestedType_*)>*); \
		template < typename U > static NoType deduce(...); \
		\
	public: \
		static const bool Value = sizeof(deduce<T>(0)) == sizeof(YesType); \
	}

	namespace Detail
	{
		struct DoesNotHaveAnyNestedTypes
		{ static const bool Value = false; };
	}

#define TOOLKIT_DECLARE_METHOD_CHECK(Method_) \
	template < typename T > \
	struct HasMethod_##Method_ \
	{ \
		template <typename Type> \
		class Impl \
		{ \
			struct BaseMixin { void Method_(){} }; \
			struct Base : public Type, public BaseMixin { Base(); }; \
			\
			template <typename V, V t>    class Helper{}; \
			\
			template <typename U> static NoType deduce(U*, Helper<void (BaseMixin::*)(), &U::Method_>* = 0); \
			static YesType deduce(...); \
			\
		public: \
			static const bool Value = (sizeof(YesType) == sizeof(deduce((Base*)(0)))); \
		}; \
		static const bool Value = \
			If	< \
					IsClass<T>::Value, \
					Impl<T>, \
					stingray::Detail::DoesNotHaveAnyNestedTypes \
				>::ValueT::Value; \
	}

}


#endif

{'fraction_non_alphanumeric': 0.14480354879594423, 'fraction_numerical': 0.002217997465145754, 'mean_word_length': 3.243279569892473, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '759545', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1119, 'n_words': 240}