12#pragma warning(disable: 4482)
13#define NO_RETURN __declspec(noreturn)
15#define NO_RETURN __attribute__((noreturn))
18#define MAX_NUM_ARRAY_ELEMENTS (1024*1024)
19#define MAX_SIZE_OF_BYTE_ARRAYS (20*1024*1024)
51 template<
typename T,
typename A,
typename... Args>
54 static constexpr bool value = std::uses_allocator<T, A>::value;
59 template<
typename T,
typename A,
typename... Args>
63 return T( std::allocator_arg, std::forward<A>(allocator), std::forward<Args>(args)... );
66 template<
typename T,
typename A,
typename... Args>
71 return T( std::forward<Args>(args)..., std::forward<A>(allocator) );
74 template<
typename T,
typename A,
typename... Args>
76 -> std::enable_if_t<!supports_allocator<T, A>::value ,
T>
78 return T( std::forward<Args>(args)... );
81 template<
typename T,
typename A,
typename... Args>
83 A&& allocator, std::tuple<Args&&...> args,
86 return std::tuple_cat( std::forward_as_tuple<std::allocator_arg_t, A>( std::allocator_arg, allocator ), args );
89 template<
typename T,
typename A,
typename... Args>
91 A&& allocator, std::tuple<>,
94 return std::forward_as_tuple<std::allocator_arg_t, A>( std::allocator_arg, allocator );
97 template<
typename T,
typename A,
typename... Args>
99 A&& allocator, std::tuple<Args&&...> args,
103 return std::tuple_cat( args, std::forward_as_tuple<A>( allocator ) );
106 template<
typename T,
typename A,
typename... Args>
108 A&& allocator, std::tuple<>,
112 return std::forward_as_tuple<A>( allocator );
115 template<
typename T,
typename A,
typename... Args>
117 A&&, std::tuple<Args&&...> args,
123 template<
typename T1,
typename T2,
typename A>
126 return std::pair<T1,T2>(
127 std::piecewise_construct,
140 const T&
min(
const T&
a,
const T& b ) {
return a < b ?
a: b; }
144 while(*(str+i) !=
'\0')
150 template<
typename Container>
154 }
else if (dest.empty()) {
155 dest = std::move(src);
157 dest.insert(std::end(dest), std::make_move_iterator(std::begin(src)), std::make_move_iterator(std::end(src)));
161 template<
typename Container>
166 dest.insert(std::end(dest), std::begin(src), std::end(src));
170 template<
typename Container>
172 if (entries.size() > 1) {
173 std::sort( entries.begin(), entries.end() );
174 auto itr = std::unique( entries.begin(), entries.end() );
175 entries.erase( itr, entries.end() );
182 template<
typename Signature>
185 template<
typename R,
typename ...Args>
188 using std::function<
R(Args...)>::function;
191 if (
static_cast<bool>(*
this)) {
192 if constexpr( std::is_move_constructible_v<R> ) {
193 return std::function<
R(Args...)>::operator()(std::move(args)...);
195 return std::function<
R(Args...)>::operator()(args...);
198 if constexpr( !std::is_void_v<R> ) {
217#define LLCONST(constant) static_cast<int64_t>(constant##ll)
218#define ULLCONST(constant) static_cast<uint64_t>(constant##ull)
auto operator()(Args... args) const -> R
auto construct_maybe_with_allocator(A &&allocator, Args &&... args) -> std::enable_if_t< supports_allocator< T, A >::value &&supports_allocator< T, A >::leading_allocator, T >
auto maybe_augment_constructor_arguments_with_allocator(A &&allocator, std::tuple< Args &&... > args, std::enable_if_t< supports_allocator< T, A >::value &&supports_allocator< T, A >::leading_allocator, int >=0)
std::pair< T1, T2 > default_construct_pair_maybe_with_allocator(A &&allocator)
fc::false_type is_class_helper(...)
void move_append(Container &dest, Container &&src)
void deduplicate(Container &entries)
constexpr size_t const_strlen(const char *str)
const T & min(const T &a, const T &b)
void copy_append(Container &dest, const Container &src)
decltype(nullptr) nullptr_t
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define T(meth, val, expected)
static constexpr bool trailing_allocator
static constexpr bool leading_allocator
static constexpr bool value
decltype(detail::is_class_helper< T >(0)) type