13 #define SIG_ENABLE_BOOST 1 // boostが使用可能か
14 #define SIG_USE_OPTIONAL 1 // boost::optionalを使用するか(大規模データを扱う際にはオーバーヘッドが影響する可能性あり)
18 #define SIG_UTIL_VERSION 095
20 #if defined(_WIN32) || defined(_WIN64) // windows env
22 #define SIG_MSVC_ENV 1
25 #elif defined(__unix__) || defined(linux) // linux env
26 #define SIG_LINUX_ENV 1
28 #if defined(__clang__)
29 #define SIG_CLANG_ENV 1
30 #elif defined(__GNUC__)
38 #define SIG_DEBUG_MODE 1
42 static_assert(
false,
"require \"Visual C++ Compiler Nov 2013 CTP (CTP_Nov2013)\" to compile on msvc");
43 #elif _MSC_VER == 1800
44 #define SIG_MSVC_VER 120
45 #elif _MSC_VER == 1900
46 #define SIG_MSVC_VER 140
50 #if __GNUC__ > 4 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 0)
51 #define SIG_GCC_GT5_0_0 1
52 #elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
53 #define SIG_GCC_GT4_9_0 1
54 #elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
55 #define SIG_GCC_GT4_8_0 1
59 #if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4)
60 #define SIG_CLANG_GT_3_4 1
61 #elif __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
62 #define SIG_CLANG_GT_3_5 1
67 #define SIG_ENABLE_CONSTEXPR (SIG_MSVC_ENV && SIG_MSVC_VER > 140) || (SIG_GCC_ENV) || (SIG_CLANG_ENV)
69 #define SIG_ENABLE_MOVEITERATOR (SIG_MSVC_ENV) || (SIG_GCC_ENV && SIG_GCC_GT5_0_0) || (SIG_CLANG_ENV)
71 #define SIG_ENABLE_FOLDR SIG_MSVC_ENV || SIG_GCC_GT5_0_0 || SIG_CLANG_GT_3_5
73 #define SIG_ENABLE_TUPLE_ZIP (SIG_MSVC_VER > 140) || SIG_GCC_GT4_9_0 || SIG_CLANG_GT_3_5
86 #if SIG_MSVC_ENV || !SIG_ENABLE_BOOST
91 #include <boost/pool/pool_alloc.hpp>
92 #include <boost/call_traits.hpp>
103 using uint = std::size_t;
104 using StrPtr = std::shared_ptr< std::string >;
105 using C_StrPtr = std::shared_ptr< std::string const >;
106 using WStrPtr = std::shared_ptr< std::wstring >;
107 using C_WStrPtr = std::shared_ptr< std::wstring const >;
109 using std::placeholders::_1;
110 using std::placeholders::_2;
115 using fragment_allocator = boost::fast_pool_allocator<T>;
118 using fragment_allocator = std::allocator<T>;
124 template <
class T>
using ParamType =
typename boost::call_traits<T>::param_type;
127 using ParamType =
typename std::conditional<std::is_class<T>::value, T
const&, T>::type;
133 using FilepassString = std::wstring;
134 using FilepassStringC =
wchar_t const*;
135 template <
class T> FilepassString to_fpstring(T v){
return std::to_wstring(v); }
136 inline void FileOpenErrorPrint(FilepassString
const& pass){ std::wcout << L
"file open error: " << pass << std::endl; }
137 #define SIG_TO_FPSTR(str) L ## str
138 #define SIG_USE_BOOST_FILESYSTEM 0
140 using FilepassString = std::string;
141 using FilepassStringC =
char const*;
142 template <
class T> FilepassString to_fpstring(T v){
return std::to_string(v); }
143 inline void FileOpenErrorPrint(FilepassString
const& pass){ std::cout <<
"file open error: " << pass << std::endl; }
144 #define SIG_TO_FPSTR(str) str
145 #define SIG_USE_BOOST_FILESYSTEM 1
149 #define SIG_FILE_LOCALE_INIT\
150 static bool first = true; \
152 std::locale::global(std::locale("")); \