18template < prototype_
integral INTEGRAL >
19constexpr INTEGRAL default_epsilon()
27template < prototype_
floating FLOATING >
28constexpr FLOATING default_epsilon()
31 return ::std::numeric_limits<FLOATING>::epsilon();
50inline bool is_empty(const ::ansi_character * p) {
return is_string_empty(p); }
51inline bool is_empty(const ::wd16_character * p) {
return is_string_empty(p); }
52inline bool is_empty(const ::wd32_character * p) {
return is_string_empty(p); }
55inline bool has_character(const ::ansi_character * p) {
return !is_empty(p); }
56inline bool has_character(const ::wd16_character * p) {
return !is_empty(p); }
57inline bool has_character(const ::wd32_character * p) {
return !is_empty(p); }
61inline ::u64 make64_from32(::u32 l, ::u32 h)
64 return ((::u64)l) | (((::u64)h) << 32);
68CLASS_DECL_ACME
void this_is_a_debugging_consumer(::i32 & i);
70inline bool is_memory_segment_ok(
const void * pMemory, memsize s)
73 auto p = (const ::u8 *)pMemory;
80#ifdef DEEP_MEMORY_SEGMENT_CHECK
112 this_is_a_debugging_consumer(sum);
133inline bool is_memory_segment_ok(
void * pMemory, memsize s)
136 auto p = (::u8 *)pMemory;
143#ifdef DEEP_MEMORY_SEGMENT_CHECK
199template <
typename TYPE >
200inline bool is_array_ok(TYPE * p, ::collection::count c)
203 return is_memory_segment_ok(p, c *
sizeof(TYPE));
208template <
typename TYPE >
209inline bool is_array_ok(
const TYPE * p, ::collection::count c)
212 return is_memory_segment_ok(p, c *
sizeof(TYPE));
217inline bool is_string_ok(::wide_character * p, character_count s)
220 return ::is_array_ok(p, s);
225inline bool is_string_ok(const ::wide_character * p, character_count s)
228 return ::is_array_ok(p, s);
233inline bool is_string_ok(::ansi_character * p, character_count s)
236 return ::is_array_ok(p, s);
241inline bool is_string_ok(const ::ansi_character * p, character_count s)
244 return ::is_array_ok(p, s);
249template <
typename TYPE >
250inline bool is_null_terminated_primitive_array_ok(TYPE * p)
282template <
typename TYPE >
283inline bool is_null_terminated_primitive_array_ok(
const TYPE * p)
313inline bool is_string_ok(::wide_character * p)
316 return is_null_terminated_primitive_array_ok(p);
321inline bool is_string_ok(const ::wide_character * p)
324 return is_null_terminated_primitive_array_ok(p);
329inline bool is_string_ok(::ansi_character * p)
332 return is_null_terminated_primitive_array_ok(p);
337inline bool is_string_ok(const ::ansi_character * p)
340 return is_null_terminated_primitive_array_ok(p);
345inline ::i32_bool address_overlaps(
const void * p1,
const void * p2, character_count len)
348 return (((::u8*)p1) <= (((::u8*)p2) + len))
349 && (((::u8*)p2) <= (((::u8*)p1) + len));
415inline const ::particle* trace_object(const ::particle* pparticle) {
return pparticle; }
421inline ::i32 read_char(::u8*& pdata, memsize& s, char_pointer pch)
463inline bool is_impact_group(::u64 u, ::u64 uGroup) {
return u >= uGroup && u < uGroup + 1000; }
466inline bool is_impact_subgroup(::u64 u, ::u64 uGroup) {
return u >= uGroup && u < uGroup + 100; }
469inline bool is_file_or_folder2(const ::file::enum_type& etype)
472 return (etype & ::file::e_type_file_or_folder2);
477inline bool is_existing_file_or_folder(const ::file::enum_type& etype)
480 return (etype & ::file::e_type_file_or_folder2) > ::file::e_type_exists;
485inline bool exists(const ::file::enum_type& etype)
488 return etype & ::file::e_type_exists;
583CLASS_DECL_ACME
void throw_exception(enum_status estatus);
586constexpr ::std::strong_ordering negation(const ::std::strong_ordering & ordering)
592 return ::std::strong_ordering::greater;
595 else if (ordering > 0)
598 return ::std::strong_ordering::less;
604 return ::std::strong_ordering::equal;
611template < prototype_
floating NUMBER1, prototype_
floating NUMBER2 >
612bool is_equal(
const NUMBER1 & n1,
const NUMBER2 & n2, largest_number < NUMBER2, NUMBER2 > epsilon = default_epsilon < largest_number < NUMBER2, NUMBER2 > >())
615 return ::std::abs(n1 - n2) < epsilon;
620template < prototype_
floating NUMBER1, prototype_
integral NUMBER2 >
621bool is_equal(
const NUMBER1 & n1,
const NUMBER2 & n2, largest_number < NUMBER2, NUMBER2 > epsilon = default_epsilon < largest_number < NUMBER2, NUMBER2 > >())
624 return ::std::abs(n1 - n2) < epsilon;
629template < prototype_
integral NUMBER1, prototype_
floating NUMBER2 >
630bool is_equal(
const NUMBER1 & n1,
const NUMBER2 & n2, largest_number < NUMBER2, NUMBER2 > epsilon = default_epsilon < largest_number < NUMBER2, NUMBER2 > >())
633 return ::std::abs(n1 - n2) < epsilon;
638template < prototype_
integral NUMBER1, prototype_
integral NUMBER2 >
639bool is_equal(
const NUMBER1 & n1,
const NUMBER2 & n2, largest_number < NUMBER2, NUMBER2 > epsilon = 0)
648template < prototype_number NUMBER1, prototype_number NUMBER2 >
649constexpr void _expand_minimum_maximum(NUMBER1 & minimum, NUMBER1 & maximum, NUMBER2 n)
655 minimum = (NUMBER1) n;
658 else if (n > maximum)
661 maximum = (NUMBER1) n;
669template < prototype_
integral NUMBER1, prototype_
integral NUMBER2 >
670constexpr void expand_minimum_maximum(NUMBER1 & minimum, NUMBER1 & maximum, NUMBER2 n)
673 _expand_minimum_maximum(minimum, maximum, n);
679template < prototype_
floating NUMBER1, prototype_
floating NUMBER2 >
680constexpr void expand_minimum_maximum(NUMBER1 & minimum, NUMBER1 & maximum, NUMBER2 n)
683 _expand_minimum_maximum(minimum, maximum, n);
689template < prototype_
floating NUMBER1, prototype_
integral NUMBER2 >
690constexpr void expand_minimum_maximum(NUMBER1 & minimum, NUMBER1 & maximum, NUMBER2 n)
693 _expand_minimum_maximum(minimum, maximum, n);
699template < prototype_
integral NUMBER1, prototype_
floating NUMBER2 >
700constexpr void expand_minimum_maximum(NUMBER1 & minimum, NUMBER1 & maximum, NUMBER2 n)
706 minimum = (NUMBER1) floor(n);
709 else if (n > maximum)
712 maximum = (NUMBER1) ceil(n);
719template <
typename TYPE >
720inline TYPE & null_reference()
723 return *((TYPE *)
nullptr);