<commit_before>/********************************************************
 * Wrapper class and helpers for flag manipulation
 *
 * Author: <NAME> <<EMAIL>>
 * Created: 		4/14/2014
 * Last modified: 	5/14/2014
 *******************************************************/

#ifndef DPSG_FLAGS_HPP
#define DPSG_FLAGS_HPP


#define DPSG_PP_NARG(...) \
	DPSG_PP_NARG_(__VA_ARGS__, DPSG_PP_RSEQ_N())

#define DPSG_PP_NARG_(...) \
	DPSG_PP_ARG_N(__VA_ARGS__)

#define DPSG_PP_ARG_N( \
		_1, _2, _3, _4, _5, _6, _7, _8,	N, ...) N

#define DPSG_PP_RSEQ_N()	\
	8, 7, 6, 5, 4, 3, 2, 1

#define DPSG_PP_EXPAND(count, ...)	\
	DPSG_PP_EXPAND_##count (__VA_ARGS__)

#define DPSG_PP_EXPAND_1(a) a = 1
#define DPSG_PP_EXPAND_2(a, b) DPSG_PP_EXPAND_1(a), b = 1 << 1
#define DPSG_PP_EXPAND_3(a, b, c) DPSG_PP_EXPAND_2(a, b), c = 1 << 2
#define DPSG_PP_EXPAND_4(a, b, c, d) DPSG_PP_EXPAND_3(a, b, c), d = 1 << 3
#define DPSG_PP_EXPAND_5(a, b, c, d, e) DPSG_PP_EXPAND_4(a, b, c, d), e = 1 << 4
#define DPSG_PP_EXPAND_6(a, b, c, d, e, f) DPSG_PP_EXPAND_5(a, b, c, d, e), f = 1 << 5
#define DPSG_PP_EXPAND_7(a, b, c, d, e, f, g) DPSG_PP_EXPAND_6(a, b, c, d, e, f), g = 1 << 6
#define DPSG_PP_EXPAND_8(a, b, c, d, e, f, g, h) DPSG_PP_EXPAND_7(a, b, c, d, e, f, g), h = 1 << 7

#define DPSG_DECLARE_FLAG_(type, name, count, ...) 					\
	class name														\
		: dpsg::detail::BaseFlag<type, count> { 					\
		typedef BaseFlag<type, count> Base;							\
		public:														\
		enum {DPSG_PP_EXPAND(count, __VA_ARGS__)}; 					\
		name() : Base(Base::Count) {}								\
		name(type i) : Base(i) {} 									\
			using Base::is_set;										\
			using Base::set;										\
			using Base::unset;										\
			using Base::toggle;										\
	};

#define DPSG_DECLARE_FLAG(type, name, ...) DPSG_DECLARE_FLAG_(type, name, DPSG_PP_NARG(__VA_ARGS__), __VA_ARGS__)

namespace dpsg { namespace detail<commit_msg>Expose type and Countfrom the base class<commit_after>/********************************************************
 * Wrapper class and helpers for flag manipulation
 *
 * Author: <NAME> <<EMAIL>>
 * Created: 		4/14/2014
 * Last modified: 	5/14/2014
 *******************************************************/

#ifndef DPSG_FLAGS_HPP
#define DPSG_FLAGS_HPP


#define DPSG_PP_NARG(...) \
	DPSG_PP_NARG_(__VA_ARGS__, DPSG_PP_RSEQ_N())

#define DPSG_PP_NARG_(...) \
	DPSG_PP_ARG_N(__VA_ARGS__)

#define DPSG_PP_ARG_N( \
		_1, _2, _3, _4, _5, _6, _7, _8,	N, ...) N

#define DPSG_PP_RSEQ_N()	\
	8, 7, 6, 5, 4, 3, 2, 1

#define DPSG_PP_EXPAND(count, ...)	\
	DPSG_PP_EXPAND_##count (__VA_ARGS__)

#define DPSG_PP_EXPAND_1(a) a = 1
#define DPSG_PP_EXPAND_2(a, b) DPSG_PP_EXPAND_1(a), b = 1 << 1
#define DPSG_PP_EXPAND_3(a, b, c) DPSG_PP_EXPAND_2(a, b), c = 1 << 2
#define DPSG_PP_EXPAND_4(a, b, c, d) DPSG_PP_EXPAND_3(a, b, c), d = 1 << 3
#define DPSG_PP_EXPAND_5(a, b, c, d, e) DPSG_PP_EXPAND_4(a, b, c, d), e = 1 << 4
#define DPSG_PP_EXPAND_6(a, b, c, d, e, f) DPSG_PP_EXPAND_5(a, b, c, d, e), f = 1 << 5
#define DPSG_PP_EXPAND_7(a, b, c, d, e, f, g) DPSG_PP_EXPAND_6(a, b, c, d, e, f), g = 1 << 6
#define DPSG_PP_EXPAND_8(a, b, c, d, e, f, g, h) DPSG_PP_EXPAND_7(a, b, c, d, e, f, g), h = 1 << 7

#define DPSG_DECLARE_FLAG_(TYPE, NAME, COUNT, ...) 					\
	class NAME														\
		: dpsg::detail::BaseFlag<TYPE, COUNT> { 					\
		typedef BaseFlag<TYPE, COUNT> Base;							\
		public:														\
		enum {DPSG_PP_EXPAND(COUNT, __VA_ARGS__)}; 					\
		NAME() : Base(Base::Count) {}								\
		NAME(TYPE i) : Base(i) {} 									\
			using Base::is_set;										\
			using Base::set;										\
			using Base::unset;										\
			using Base::toggle;										\
			using Base::Count;										\
			using Base::type;										\
	};

#define DPSG_DECLARE_FLAG(type, name, ...) DPSG_DECLARE_FLAG_(type, name, DPSG_PP_NARG(__VA_ARGS__), __VA_ARGS__)

namespace dpsg { namespace detail
{'fraction_non_alphanumeric': 0.20902489626556017, 'fraction_numerical': 0.03112033195020747, 'mean_word_length': 3.299888517279822, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '160122', 'n_tokens_mistral': 2072, 'n_tokens_neox': 1766, 'n_words': 385}