mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
add stringize preprocessor
add random using add some headers
This commit is contained in:
parent
1766ed43a4
commit
89e2be54fa
24 changed files with 166 additions and 7 deletions
7
sprout/checksum.hpp
Normal file
7
sprout/checksum.hpp
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef SPROUT_CHECKSUM_HPP
|
||||
#define SPROUT_CHECKSUM_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/checksum/sha1.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_CHECKSUM_HPP
|
8
sprout/integer/bit.hpp
Normal file
8
sprout/integer/bit.hpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef SPROUT_INTEGER_BIT_HPP
|
||||
#define SPROUT_INTEGER_BIT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/integer/bit_length.hpp>
|
||||
#include <sprout/integer/bit_reverse.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_INTEGER_BIT_HPP
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/iterator/reverse_iterator.hpp>
|
||||
#include <sprout/iterator/predefined.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_ITERATOR_HPP
|
||||
|
|
10
sprout/iterator/predefined.hpp
Normal file
10
sprout/iterator/predefined.hpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef SPROUT_ITERATOR_PREDEFINED_HPP
|
||||
#define SPROUT_ITERATOR_PREDEFINED_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/reverse_iterator.hpp>
|
||||
#include <sprout/iterator/index_iterator.hpp>
|
||||
#include <sprout/iterator/value_iterator.hpp>
|
||||
#include <sprout/iterator/bytes_iterator.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_ITERATOR_PREDEFINED_HPP
|
10
sprout/preprocessor.hpp
Normal file
10
sprout/preprocessor.hpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_HPP
|
||||
#define SPROUT_PREPROCESSOR_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/preprocessor/cat.hpp>
|
||||
#include <sprout/preprocessor/stringize_all.hpp>
|
||||
#include <sprout/preprocessor/str_all.hpp>
|
||||
#include <sprout/preprocessor/unique_string.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_PREPROCESSOR_HPP
|
10
sprout/preprocessor/str_all.hpp
Normal file
10
sprout/preprocessor/str_all.hpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_STR_ALL_HPP
|
||||
#define SPROUT_PREPROCESSOR_STR_ALL_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/preprocessor/wstr.hpp>
|
||||
#include <sprout/preprocessor/u16str.hpp>
|
||||
#include <sprout/preprocessor/u32str.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_PREPROCESSOR_STR_ALL_HPP
|
||||
|
|
@ -3,12 +3,11 @@
|
|||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
#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
|
||||
|
||||
|
|
11
sprout/preprocessor/stringize_all.hpp
Normal file
11
sprout/preprocessor/stringize_all.hpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP
|
||||
#define SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/preprocessor/stringize.hpp>
|
||||
#include <sprout/preprocessor/wstringize.hpp>
|
||||
#include <sprout/preprocessor/u16stringize.hpp>
|
||||
#include <sprout/preprocessor/u32stringize.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_PREPROCESSOR_STRINGIZE_ALL_HPP
|
||||
|
13
sprout/preprocessor/u16str.hpp
Normal file
13
sprout/preprocessor/u16str.hpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_U16STR_HPP
|
||||
#define SPROUT_PREPROCESSOR_U16STR_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// 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
|
||||
|
14
sprout/preprocessor/u16stringize.hpp
Normal file
14
sprout/preprocessor/u16stringize.hpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_U16STRINGIZE_HPP
|
||||
#define SPROUT_PREPROCESSOR_U16STRINGIZE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// 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
|
||||
|
13
sprout/preprocessor/u32str.hpp
Normal file
13
sprout/preprocessor/u32str.hpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_U32STR_HPP
|
||||
#define SPROUT_PREPROCESSOR_U32STR_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// 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
|
||||
|
14
sprout/preprocessor/u32stringize.hpp
Normal file
14
sprout/preprocessor/u32stringize.hpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_U32STRINGIZE_HPP
|
||||
#define SPROUT_PREPROCESSOR_U32STRINGIZE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// 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
|
||||
|
|
@ -2,12 +2,22 @@
|
|||
#define SPROUT_PREPROCESSOR_UNIQUE_STRING_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/preprocessor/stringize.hpp>
|
||||
#include <sprout/preprocessor/stringize_all.hpp>
|
||||
#include <sprout/preprocessor/str_all.hpp>
|
||||
|
||||
//
|
||||
// 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
|
||||
|
||||
|
|
13
sprout/preprocessor/wstr.hpp
Normal file
13
sprout/preprocessor/wstr.hpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_WSTR_HPP
|
||||
#define SPROUT_PREPROCESSOR_WSTR_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// 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
|
||||
|
14
sprout/preprocessor/wstringize.hpp
Normal file
14
sprout/preprocessor/wstringize.hpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#ifndef SPROUT_PREPROCESSOR_WSTRINGIZE_HPP
|
||||
#define SPROUT_PREPROCESSOR_WSTRINGIZE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// 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
|
||||
|
|
@ -21,5 +21,6 @@
|
|||
#include <sprout/random/variate_generator.hpp>
|
||||
#include <sprout/random/random_result.hpp>
|
||||
#include <sprout/random/random_iterator.hpp>
|
||||
#include <sprout/random/unique_seed.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_RANDOM_HPP
|
||||
|
|
|
@ -96,12 +96,13 @@ namespace sprout {
|
|||
//
|
||||
// ecuyer1988
|
||||
//
|
||||
typedef additive_combine_engine<
|
||||
typedef sprout::random::additive_combine_engine<
|
||||
sprout::random::linear_congruential_engine<std::uint32_t, 40014, 0, 2147483563>,
|
||||
sprout::random::linear_congruential_engine<std::uint32_t, 40692, 0, 2147483399>
|
||||
> ecuyer1988;
|
||||
} // namespace random
|
||||
|
||||
using sprout::random::additive_combine_engine;
|
||||
using sprout::random::ecuyer1988;
|
||||
} // namespace sprout
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ namespace sprout {
|
|||
typedef sprout::random::inversive_congruential_engine<std::uint32_t, 9102, 2147483647 - 36884165, 2147483647> hellekalek1995;
|
||||
} // namespace random
|
||||
|
||||
using sprout::random::inversive_congruential_engine;
|
||||
using sprout::random::hellekalek1995;
|
||||
} // namespace sprout
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -107,6 +107,8 @@ namespace sprout {
|
|||
template<typename UIntType, int w, int k, int q, int s>
|
||||
SPROUT_CONSTEXPR UIntType sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::default_seed;
|
||||
} // namespace random
|
||||
|
||||
using sprout::random::linear_feedback_shift_engine;
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_RANDOM_LINEAR_FEEDBACK_SHIFT_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;
|
||||
|
|
|
@ -171,13 +171,14 @@ namespace sprout {
|
|||
//
|
||||
// knuth_b
|
||||
//
|
||||
typedef shuffle_order_engine<sprout::random::minstd_rand0, 256> knuth_b;
|
||||
typedef sprout::random::shuffle_order_engine<sprout::random::minstd_rand0, 256> knuth_b;
|
||||
//
|
||||
// kreutzer1986
|
||||
//
|
||||
typedef sprout::random::shuffle_order_engine<sprout::random::linear_congruential_engine<std::uint32_t, 1366, 150889, 714025>, 97> kreutzer1986;
|
||||
} // namespace random
|
||||
|
||||
using sprout::random::shuffle_order_engine;
|
||||
using sprout::random::knuth_b;
|
||||
using sprout::random::kreutzer1986;
|
||||
} // namespace sprout
|
||||
|
|
|
@ -85,6 +85,8 @@ namespace sprout {
|
|||
template<typename URNG1, int s1, typename URNG2, int s2>
|
||||
SPROUT_CONSTEXPR int sprout::random::xor_combine_engine<URNG1, s1, URNG2, s2>::shift2;
|
||||
} // namespace random
|
||||
|
||||
using sprout::random::xor_combine_engine;
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_RANDOM_XOR_COMBINE_HPP
|
||||
|
|
|
@ -6,5 +6,8 @@
|
|||
#include <sprout/utility/rel_ops.hpp>
|
||||
#include <sprout/utility/operation.hpp>
|
||||
#include <sprout/utility/operation_ext.hpp>
|
||||
#include <sprout/utility/enabler_if.hpp>
|
||||
#include <sprout/utility/pack.hpp>
|
||||
#include <sprout/utility/value_holder.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_UTILITY_HPP
|
||||
|
|
Loading…
Reference in a new issue