From 89e2be54faee45bfe201a1ef286f07397bcb70cb Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sat, 14 Apr 2012 12:31:47 +0900 Subject: [PATCH] add stringize preprocessor add random using add some headers --- sprout/checksum.hpp | 7 +++++++ sprout/integer/bit.hpp | 8 ++++++++ sprout/iterator.hpp | 2 +- sprout/iterator/predefined.hpp | 10 ++++++++++ sprout/preprocessor.hpp | 10 ++++++++++ sprout/preprocessor/str_all.hpp | 10 ++++++++++ sprout/preprocessor/stringize.hpp | 3 +-- sprout/preprocessor/stringize_all.hpp | 11 +++++++++++ sprout/preprocessor/u16str.hpp | 13 +++++++++++++ sprout/preprocessor/u16stringize.hpp | 14 ++++++++++++++ sprout/preprocessor/u32str.hpp | 13 +++++++++++++ sprout/preprocessor/u32stringize.hpp | 14 ++++++++++++++ sprout/preprocessor/unique_string.hpp | 14 ++++++++++++-- sprout/preprocessor/wstr.hpp | 13 +++++++++++++ sprout/preprocessor/wstringize.hpp | 14 ++++++++++++++ sprout/random.hpp | 1 + sprout/random/additive_combine.hpp | 3 ++- sprout/random/inversive_congruential.hpp | 1 + sprout/random/linear_congruential.hpp | 1 + sprout/random/linear_feedback_shift.hpp | 2 ++ sprout/random/mersenne_twister.hpp | 1 + sprout/random/shuffle_order.hpp | 3 ++- sprout/random/xor_combine.hpp | 2 ++ sprout/utility.hpp | 3 +++ 24 files changed, 166 insertions(+), 7 deletions(-) create mode 100644 sprout/checksum.hpp create mode 100644 sprout/integer/bit.hpp create mode 100644 sprout/iterator/predefined.hpp create mode 100644 sprout/preprocessor.hpp create mode 100644 sprout/preprocessor/str_all.hpp create mode 100644 sprout/preprocessor/stringize_all.hpp create mode 100644 sprout/preprocessor/u16str.hpp create mode 100644 sprout/preprocessor/u16stringize.hpp create mode 100644 sprout/preprocessor/u32str.hpp create mode 100644 sprout/preprocessor/u32stringize.hpp create mode 100644 sprout/preprocessor/wstr.hpp create mode 100644 sprout/preprocessor/wstringize.hpp diff --git a/sprout/checksum.hpp b/sprout/checksum.hpp new file mode 100644 index 00000000..1403feb2 --- /dev/null +++ b/sprout/checksum.hpp @@ -0,0 +1,7 @@ +#ifndef SPROUT_CHECKSUM_HPP +#define SPROUT_CHECKSUM_HPP + +#include +#include + +#endif // #ifndef SPROUT_CHECKSUM_HPP diff --git a/sprout/integer/bit.hpp b/sprout/integer/bit.hpp new file mode 100644 index 00000000..13052399 --- /dev/null +++ b/sprout/integer/bit.hpp @@ -0,0 +1,8 @@ +#ifndef SPROUT_INTEGER_BIT_HPP +#define SPROUT_INTEGER_BIT_HPP + +#include +#include +#include + +#endif // #ifndef SPROUT_INTEGER_BIT_HPP diff --git a/sprout/iterator.hpp b/sprout/iterator.hpp index e0aed73d..c21a8e18 100644 --- a/sprout/iterator.hpp +++ b/sprout/iterator.hpp @@ -3,6 +3,6 @@ #include #include -#include +#include #endif // #ifndef SPROUT_ITERATOR_HPP diff --git a/sprout/iterator/predefined.hpp b/sprout/iterator/predefined.hpp new file mode 100644 index 00000000..f125f729 --- /dev/null +++ b/sprout/iterator/predefined.hpp @@ -0,0 +1,10 @@ +#ifndef SPROUT_ITERATOR_PREDEFINED_HPP +#define SPROUT_ITERATOR_PREDEFINED_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_ITERATOR_PREDEFINED_HPP diff --git a/sprout/preprocessor.hpp b/sprout/preprocessor.hpp new file mode 100644 index 00000000..4b64a3cc --- /dev/null +++ b/sprout/preprocessor.hpp @@ -0,0 +1,10 @@ +#ifndef SPROUT_PREPROCESSOR_HPP +#define SPROUT_PREPROCESSOR_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_PREPROCESSOR_HPP diff --git a/sprout/preprocessor/str_all.hpp b/sprout/preprocessor/str_all.hpp new file mode 100644 index 00000000..f1df72d9 --- /dev/null +++ b/sprout/preprocessor/str_all.hpp @@ -0,0 +1,10 @@ +#ifndef SPROUT_PREPROCESSOR_STR_ALL_HPP +#define SPROUT_PREPROCESSOR_STR_ALL_HPP + +#include +#include +#include +#include + +#endif // #ifndef SPROUT_PREPROCESSOR_STR_ALL_HPP + diff --git a/sprout/preprocessor/stringize.hpp b/sprout/preprocessor/stringize.hpp index c65d4e5e..aaf2baf6 100644 --- a/sprout/preprocessor/stringize.hpp +++ b/sprout/preprocessor/stringize.hpp @@ -3,12 +3,11 @@ #include -#define SPROUT_PP_STRINGIZE_I(text) #text - // // SPROUT_PP_STRINGIZE // #define SPROUT_PP_STRINGIZE(text) SPROUT_PP_STRINGIZE_I(text) +#define SPROUT_PP_STRINGIZE_I(text) #text #endif // #ifndef SPROUT_PREPROCESSOR_STRINGIZE_HPP diff --git a/sprout/preprocessor/stringize_all.hpp b/sprout/preprocessor/stringize_all.hpp new file mode 100644 index 00000000..fec94629 --- /dev/null +++ b/sprout/preprocessor/stringize_all.hpp @@ -0,0 +1,11 @@ +#ifndef SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP +#define SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP + diff --git a/sprout/preprocessor/u16str.hpp b/sprout/preprocessor/u16str.hpp new file mode 100644 index 00000000..b0993355 --- /dev/null +++ b/sprout/preprocessor/u16str.hpp @@ -0,0 +1,13 @@ +#ifndef SPROUT_PREPROCESSOR_U16STR_HPP +#define SPROUT_PREPROCESSOR_U16STR_HPP + +#include + +// +// SPROUT_PP_U16STR +// +#define SPROUT_PP_U16STR(str) SPROUT_PP_U16STR_I(str) +#define SPROUT_PP_U16STR_I(str) u ## str + +#endif // #ifndef SPROUT_PREPROCESSOR_U16STR_HPP + diff --git a/sprout/preprocessor/u16stringize.hpp b/sprout/preprocessor/u16stringize.hpp new file mode 100644 index 00000000..74bcd29f --- /dev/null +++ b/sprout/preprocessor/u16stringize.hpp @@ -0,0 +1,14 @@ +#ifndef SPROUT_PREPROCESSOR_U16STRINGIZE_HPP +#define SPROUT_PREPROCESSOR_U16STRINGIZE_HPP + +#include + +// +// SPROUT_PP_U16STRINGIZE +// +#define SPROUT_PP_U16STRINGIZE(text) SPROUT_PP_U16STRINGIZE_I(text) +#define SPROUT_PP_U16STRINGIZE_I(text) SPROUT_PP_U16STRINGIZE_II(#text) +#define SPROUT_PP_U16STRINGIZE_II(str) u ## str + +#endif // #ifndef SPROUT_PREPROCESSOR_U16STRINGIZE_HPP + diff --git a/sprout/preprocessor/u32str.hpp b/sprout/preprocessor/u32str.hpp new file mode 100644 index 00000000..6b1f651c --- /dev/null +++ b/sprout/preprocessor/u32str.hpp @@ -0,0 +1,13 @@ +#ifndef SPROUT_PREPROCESSOR_U32STR_HPP +#define SPROUT_PREPROCESSOR_U32STR_HPP + +#include + +// +// SPROUT_PP_U32STR +// +#define SPROUT_PP_U32STR(str) SPROUT_PP_U32STR_I(str) +#define SPROUT_PP_U32STR_I(str) U ## str + +#endif // #ifndef SPROUT_PREPROCESSOR_U32STR_HPP + diff --git a/sprout/preprocessor/u32stringize.hpp b/sprout/preprocessor/u32stringize.hpp new file mode 100644 index 00000000..45ca28c8 --- /dev/null +++ b/sprout/preprocessor/u32stringize.hpp @@ -0,0 +1,14 @@ +#ifndef SPROUT_PREPROCESSOR_U32STRINGIZE_HPP +#define SPROUT_PREPROCESSOR_U32STRINGIZE_HPP + +#include + +// +// SPROUT_PP_U32STRINGIZE +// +#define SPROUT_PP_U32STRINGIZE(text) SPROUT_PP_U32STRINGIZE_I(text) +#define SPROUT_PP_U32STRINGIZE_I(text) SPROUT_PP_U32STRINGIZE_II(#text) +#define SPROUT_PP_U32STRINGIZE_II(str) U ## str + +#endif // #ifndef SPROUT_PREPROCESSOR_U32STRINGIZE_HPP + diff --git a/sprout/preprocessor/unique_string.hpp b/sprout/preprocessor/unique_string.hpp index 77dabca3..0fd16a65 100644 --- a/sprout/preprocessor/unique_string.hpp +++ b/sprout/preprocessor/unique_string.hpp @@ -2,12 +2,22 @@ #define SPROUT_PREPROCESSOR_UNIQUE_STRING_HPP #include -#include +#include +#include // // SPROUT_PP_UNIQUE_STRING +// SPROUT_PP_UNIQUE_WSTRING +// SPROUT_PP_UNIQUE_U16STRING +// SPROUT_PP_UNIQUE_U32STRING // -#define SPROUT_PP_UNIQUE_STRING __DATE__ " " __TIME__ " : " __FILE__ "(" SPROUT_PP_STRINGIZE(__LINE__) ")" +#define SPROUT_PP_UNIQUE_STRING __DATE__ " " __TIME__ " : " __FILE__ ":" SPROUT_PP_STRINGIZE(__LINE__) +#define SPROUT_PP_UNIQUE_WSTRING SPROUT_PP_WSTR(__DATE__) SPROUT_PP_WSTR(" ") SPROUT_PP_WSTR(__TIME__) \ + SPROUT_PP_WSTR(" : ") SPROUT_PP_WSTR(__FILE__) SPROUT_PP_WSTR(":") SPROUT_PP_WSTRINGIZE(__LINE__) +#define SPROUT_PP_UNIQUE_U16STRING SPROUT_PP_U16STR(__DATE__) SPROUT_PP_U16STR(" ") SPROUT_PP_U16STR(__TIME__) \ + SPROUT_PP_U16STR(" : ") SPROUT_PP_U16STR(__FILE__) SPROUT_PP_U16STR(":") SPROUT_PP_U16STRINGIZE(__LINE__) +#define SPROUT_PP_UNIQUE_U32STRING SPROUT_PP_U32STR(__DATE__) SPROUT_PP_U32STR(" ") SPROUT_PP_U32STR(__TIME__) \ + SPROUT_PP_U32STR(" : ") SPROUT_PP_U32STR(__FILE__) SPROUT_PP_U32STR(":") SPROUT_PP_U32STRINGIZE(__LINE__) #endif // #ifndef SPROUT_PREPROCESSOR_UNIQUE_STRING_HPP diff --git a/sprout/preprocessor/wstr.hpp b/sprout/preprocessor/wstr.hpp new file mode 100644 index 00000000..e51f1ac6 --- /dev/null +++ b/sprout/preprocessor/wstr.hpp @@ -0,0 +1,13 @@ +#ifndef SPROUT_PREPROCESSOR_WSTR_HPP +#define SPROUT_PREPROCESSOR_WSTR_HPP + +#include + +// +// SPROUT_PP_WSTR +// +#define SPROUT_PP_WSTR(str) SPROUT_PP_WSTR_I(str) +#define SPROUT_PP_WSTR_I(str) L ## str + +#endif // #ifndef SPROUT_PREPROCESSOR_WSTR_HPP + diff --git a/sprout/preprocessor/wstringize.hpp b/sprout/preprocessor/wstringize.hpp new file mode 100644 index 00000000..6fb48039 --- /dev/null +++ b/sprout/preprocessor/wstringize.hpp @@ -0,0 +1,14 @@ +#ifndef SPROUT_PREPROCESSOR_WSTRINGIZE_HPP +#define SPROUT_PREPROCESSOR_WSTRINGIZE_HPP + +#include + +// +// SPROUT_PP_WSTRINGIZE +// +#define SPROUT_PP_WSTRINGIZE(text) SPROUT_PP_WSTRINGIZE_I(text) +#define SPROUT_PP_WSTRINGIZE_I(text) SPROUT_PP_WSTRINGIZE_II(#text) +#define SPROUT_PP_WSTRINGIZE_II(str) L ## str + +#endif // #ifndef SPROUT_PREPROCESSOR_WSTRINGIZE_HPP + diff --git a/sprout/random.hpp b/sprout/random.hpp index ff00afbf..42f5ab0a 100644 --- a/sprout/random.hpp +++ b/sprout/random.hpp @@ -21,5 +21,6 @@ #include #include #include +#include #endif // #ifndef SPROUT_RANDOM_HPP diff --git a/sprout/random/additive_combine.hpp b/sprout/random/additive_combine.hpp index f17b0324..bd416e9a 100644 --- a/sprout/random/additive_combine.hpp +++ b/sprout/random/additive_combine.hpp @@ -96,12 +96,13 @@ namespace sprout { // // ecuyer1988 // - typedef additive_combine_engine< + typedef sprout::random::additive_combine_engine< sprout::random::linear_congruential_engine, sprout::random::linear_congruential_engine > ecuyer1988; } // namespace random + using sprout::random::additive_combine_engine; using sprout::random::ecuyer1988; } // namespace sprout diff --git a/sprout/random/inversive_congruential.hpp b/sprout/random/inversive_congruential.hpp index 43487e3f..039dfb61 100644 --- a/sprout/random/inversive_congruential.hpp +++ b/sprout/random/inversive_congruential.hpp @@ -125,6 +125,7 @@ namespace sprout { typedef sprout::random::inversive_congruential_engine hellekalek1995; } // namespace random + using sprout::random::inversive_congruential_engine; using sprout::random::hellekalek1995; } // namespace sprout diff --git a/sprout/random/linear_congruential.hpp b/sprout/random/linear_congruential.hpp index 7a43e46a..444ef144 100644 --- a/sprout/random/linear_congruential.hpp +++ b/sprout/random/linear_congruential.hpp @@ -211,6 +211,7 @@ namespace sprout { }; } // namespace random + using sprout::random::linear_congruential_engine; using sprout::random::minstd_rand0; using sprout::random::minstd_rand; using sprout::random::rand48; diff --git a/sprout/random/linear_feedback_shift.hpp b/sprout/random/linear_feedback_shift.hpp index bd8c29be..0080ba19 100644 --- a/sprout/random/linear_feedback_shift.hpp +++ b/sprout/random/linear_feedback_shift.hpp @@ -107,6 +107,8 @@ namespace sprout { template SPROUT_CONSTEXPR UIntType sprout::random::linear_feedback_shift_engine::default_seed; } // namespace random + + using sprout::random::linear_feedback_shift_engine; } // namespace sprout #endif // #ifndef SPROUT_RANDOM_LINEAR_FEEDBACK_SHIFT_HPP diff --git a/sprout/random/mersenne_twister.hpp b/sprout/random/mersenne_twister.hpp index 221954f5..53f55d61 100644 --- a/sprout/random/mersenne_twister.hpp +++ b/sprout/random/mersenne_twister.hpp @@ -459,6 +459,7 @@ namespace sprout { > mt19937_64; } // namespace random + using sprout::random::mersenne_twister_engine; using sprout::random::mt11213b; using sprout::random::mt19937; using sprout::random::mt19937_64; diff --git a/sprout/random/shuffle_order.hpp b/sprout/random/shuffle_order.hpp index 46f0c6e2..befb4efa 100644 --- a/sprout/random/shuffle_order.hpp +++ b/sprout/random/shuffle_order.hpp @@ -171,13 +171,14 @@ namespace sprout { // // knuth_b // - typedef shuffle_order_engine knuth_b; + typedef sprout::random::shuffle_order_engine knuth_b; // // kreutzer1986 // typedef sprout::random::shuffle_order_engine, 97> kreutzer1986; } // namespace random + using sprout::random::shuffle_order_engine; using sprout::random::knuth_b; using sprout::random::kreutzer1986; } // namespace sprout diff --git a/sprout/random/xor_combine.hpp b/sprout/random/xor_combine.hpp index 35d555fe..7de0e869 100644 --- a/sprout/random/xor_combine.hpp +++ b/sprout/random/xor_combine.hpp @@ -85,6 +85,8 @@ namespace sprout { template SPROUT_CONSTEXPR int sprout::random::xor_combine_engine::shift2; } // namespace random + + using sprout::random::xor_combine_engine; } // namespace sprout #endif // #ifndef SPROUT_RANDOM_XOR_COMBINE_HPP diff --git a/sprout/utility.hpp b/sprout/utility.hpp index ec762fd6..3734ae6f 100644 --- a/sprout/utility.hpp +++ b/sprout/utility.hpp @@ -6,5 +6,8 @@ #include #include #include +#include +#include +#include #endif // #ifndef SPROUT_UTILITY_HPP