NCBI C++ ToolKit
compile_time_bits.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef __COMPILE_TIME_BITS_HPP_INCLUDED__
2 #define __COMPILE_TIME_BITS_HPP_INCLUDED__
3 
4 /* $Id: compile_time_bits.hpp 101910 2024-03-01 15:00:29Z gouriano $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Sergiy Gotvyanskyy
30  *
31  * File Description:
32  *
33  * various compile time structures and functions
34  *
35  *
36  */
37 
38 #include <type_traits>
39 #include <cstdint>
40 #include <limits>
41 #include <stdexcept>
42 #include <array>
43 #include <algorithm>
44 
45 // forward declarations to avoid unnecessary includes
46 namespace ncbi
47 {
48  class CTempString;
49  class CTempStringEx;
50 }
51 
52 namespace std
53 { // backported C++20,23 defs
54 
55 #ifndef __cpp_lib_remove_cvref
56  template< class T >
57  struct remove_cvref {
58  typedef std::remove_cv_t<std::remove_reference_t<T>> type;
59  };
60  template< class T >
62 #endif
63 
64 // backported C++23
65 #ifndef __cpp_lib_to_underlying
66  template< class Enum >
67  constexpr std::underlying_type_t<Enum> to_underlying( Enum e ) noexcept
68  {
69  return static_cast<std::underlying_type_t<Enum>>(e);
70  }
71 #endif
72 
73 }
74 
75 // on some compilers tuple are undeveloped for constexpr
76 #if defined(NCBI_COMPILER_ICC) || (defined(NCBI_COMPILER_MSVC) && NCBI_COMPILER_VERSION<=1916)
77 # define ct_const_tuple compile_time_bits::const_tuple
78 # include "const_tuple.hpp"
79 #else
80 # define ct_const_tuple std::tuple
81 # define const_tuple std::tuple
82 #endif
83 
84 #define ct_const_array std::array
85 #define const_array std::array
86 
87 #include "ct_string_cxx17.hpp"
88 
89 
90 #ifndef __cpp_lib_hardware_interference_size
91 namespace std
92 {// these are backported implementations of C++17 methods
95 }
96 #endif
97 
99 {
100  template <typename T>
101  struct array_size {};
102 
103  template <typename T>
105 
106  template <typename T, std::size_t N>
107  struct array_size<const_array<T, N>>: std::integral_constant<size_t, N> {};
108 
109  template <typename T, std::size_t N>
110  struct array_size<T[N]>: std::integral_constant<size_t, N> {};
111 
112  template<typename T>
113  constexpr size_t get_array_size(T&&)
114  {
115  return array_size<T>::value;
116  }
117 
118  template<typename T>
119  struct array_elem{};
120 
121  template<typename T>
123 
124  template<typename T>
126 
127  template<typename T, size_t N>
128  struct array_elem<T[N]>
129  {
130  using type = T;
131  };
132  template<typename T, size_t N>
134  {
135  using type = T;
136  };
137  template<typename T>
139 
140  template <typename T,
141  size_t N = array_size<T>::value,
142  typename _Elem = array_elem_t<T>,
143  std::size_t... I>
144  constexpr auto to_array_impl(T&& a, std::index_sequence<I...>)
146  {
147  return {a[I]...};
148  }
149 
151  constexpr auto make_array(T&& a)
152  {
153  return to_array_impl(std::forward<T>(a), std::make_index_sequence<N>{});
154  }
155  template <typename T, size_t N>
156  constexpr auto make_array(T const (&a)[N])
157  {
158  return to_array_impl(a, std::make_index_sequence<N>{});
159  }
160 
161  template <
162  typename...TArgs,
163  size_t N=sizeof...(TArgs),
164  typename _Tuple=typename std::enable_if<(N>1),
165  std::tuple<TArgs...>>::type,
166  typename T = std::tuple_element_t<0, _Tuple>
167  >
168  constexpr auto make_array(TArgs&&...args)
169  {
170  T _array[] = { std::forward<TArgs>(args)... };
171  return make_array(_array);
172  }
173 
174 }
175 
176 namespace compile_time_bits
177 {
178  template<typename T, typename _Unused=T>
180  {
181  using type = T;
182  };
183 
184  template<typename T>
185  struct real_underlying_type<T, std::enable_if_t<std::is_enum<T>::value, T>>
186  {
187  using type = std::underlying_type_t<T>;
188  };
189  template<typename T>
191 
192  template< class Enum>
194  {
195  return static_cast<real_underlying_type_t<Enum>>(e);
196  }
197 
198 
199  // write your own DeduceType specialization if required
200  template<typename _BaseType, typename _BackType=_BaseType>
201  struct DeduceType
202  {
203  using value_type = _BaseType;
204  using init_type = _BackType;
205  using hash_type = void; //this is basic type, it doesn't have any comparison rules
206  };
207 
208  template<typename _BaseType>
209  struct DeduceType<_BaseType, std::enable_if_t<
210  std::is_enum<_BaseType>::value ||
211  std::numeric_limits<_BaseType>::is_integer,
212  _BaseType>>
213  {
214  using value_type = _BaseType;
215  using init_type = _BaseType;
216  using hash_type = _BaseType;
217  //using hash_type = real_underlying_type_t<_BaseType>;
218  using hash_compare = std::less<hash_type>;
219  using value_compare = std::less<value_type>;
220  };
221 
222  template<class _CharType, typename tag=tagStrCase>
223  struct StringType
224  {
226  using case_tag = tag;
227 
228  using value_type = view;
229  using init_type = view;
230  using hash_type = view;
231 
232  using hash_compare = std::less<tag>;
233  using value_compare = std::less<tag>;
234  };
235 
236  template<typename, typename = void>
237  struct is_string_type : std::false_type {};
238 
239  template<typename _T>
240  struct is_string_type<_T, std::void_t<typename _T::case_tag>> : std::true_type {};
241 
242 
243  template<>
244  struct DeduceType<tagStrCase>: StringType<char, tagStrCase> {};
245 
246  template<>
247  struct DeduceType<tagStrNocase>: StringType<char, tagStrNocase> {};
248 
249 
250  template<class _CharType>
251  struct DeduceType<
252  _CharType*,
253  std::enable_if_t<
258  _CharType*>
259  > : StringType<_CharType> {};
260 
261  template<typename T>
263 
264  template<class T>
265  struct DeduceType<
266  T,
267  std::enable_if_t<
268  std::is_same<T, ncbi::CTempString>::value ||
269  std::is_same<T, ncbi::CTempStringEx>::value,
270  T>
271  > : StringType<char>
272  {};
273 
274  template<class _CharType>
275  struct DeduceType<ct_basic_string<_CharType>> : StringType<_CharType> {};
276 
277  template<class _CharType, class Traits, class Allocator>
278  struct DeduceType<std::basic_string<_CharType, Traits, Allocator>>
279  : StringType<_CharType>
280  {};
281 
282  template<class _CharType, class Traits>
283  struct DeduceType<std::basic_string_view<_CharType, Traits>>
284  : StringType<_CharType>
285  {};
286 
287  template<typename..._Types>
288  struct DeduceType<std::pair<_Types...>>
289  {
291  using init_type = std::pair<typename DeduceType<_Types>::init_type...>;
292  using hash_type = void;
293  };
294 
295  template<typename..._Types>
296  struct DeduceType<std::tuple<_Types...>>
297  {
300  using hash_type = void;
301  };
302 
303  // there is nothing to deduce if type has init_type and value_type members
304  template<class _Self>
305  struct DeduceType<_Self,
306  std::enable_if_t<
307  std::is_copy_constructible<typename _Self::init_type>::value &&
308  std::is_copy_constructible<typename _Self::value_type>::value,
309  _Self>> : _Self {};
310 
311 
312  template<typename T>
314 
315 }
316 
317 namespace compile_time_bits
318 {
319  // non-containing constexpr vector
320  template<typename _Type>
322  {
323  public:
324  using value_type = _Type;
325  using size_type = std::size_t;
326  using difference_type = std::ptrdiff_t;
327  using reference = const value_type&;
328  using const_reference = const value_type&;
329  using pointer = const value_type*;
330  using const_pointer = const value_type*;
331  using iterator = pointer;
333  using reverse_iterator = std::reverse_iterator<iterator>;
334  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
335 
336  constexpr const_vector() = default;
337  constexpr const_vector(const_pointer data, size_t size )
338  : m_size{size}, m_data{data} {}
339 
340  constexpr const_vector(std::nullptr_t) {}
341 
342  template<size_t N>
343  constexpr const_vector(const std::array<value_type, N>& data )
344  : m_size{data.size()}, m_data{data.data()} {}
345 
346  template<size_t N>
347  constexpr const_vector(value_type const (&init)[N]) : m_size{N}, m_data{init} {}
348 
349  constexpr const_reference operator[](size_t index) const { return m_data[index]; }
350  constexpr const_reference at(size_t index) const { return m_data[index]; }
351  constexpr const_pointer data() const noexcept { return m_data; }
352 
353  constexpr const_reference front() const { return m_data[0]; }
354  constexpr const_reference back() const { return m_data[m_size-1]; }
355 
356  constexpr size_type size() const noexcept { return m_size; }
357  constexpr size_type max_size() const noexcept { return size(); }
358  constexpr size_type capacity() const noexcept { return size(); }
359  [[nodiscard]] constexpr bool empty() const noexcept { return size() == 0; }
360 
361  constexpr const_iterator begin() const noexcept { return m_data; }
362  constexpr const_iterator cbegin() const noexcept { return begin(); }
363  constexpr const_iterator end() const noexcept { return begin() + size(); }
364  constexpr const_iterator cend() const noexcept { return end(); }
365  constexpr const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator{ end() }; }
366  constexpr const_reverse_iterator rcbegin() const noexcept { return rbegin(); }
367  constexpr const_reverse_iterator rend() const noexcept { return const_reverse_iterator{ begin() }; }
368  constexpr const_reverse_iterator rcend() const noexcept { return rend(); }
369 
370  protected:
371  size_t m_size = 0;
373  };
374 }
375 
376 namespace compile_time_bits
377 {
378  using tag_DuplicatesYes = std::true_type;
379  using tag_DuplicatesNo = std::false_type;
380 
381  using tag_SortByHashes = std::true_type;
382  using tag_SortByValues = std::false_type;
383 
384  template<typename _Traits, typename _AllowDuplicates>
385  class TInsertSorter;
386 
387  template<typename _Ty>
389  {
391 
397 
398  static constexpr hash_type get_init_hash(const init_type& v)
399  {
400  return v;
401  }
402  static constexpr const key_type& get_key(const value_type& v)
403  {
404  return v;
405  }
406  static constexpr value_type construct(const init_type& v)
407  {
408  return v;
409  }
410  };
411 
412  template<typename _T1, typename _T2>
414  {
419 
421  using hash_type = typename HT1::hash_type;
422  using init_type = typename pair_type::init_type;
423  using init_key_type = typename HT1::init_type;
424  using key_type = typename HT1::value_type;
425 
426  static constexpr hash_type get_init_hash(const init_type& v)
427  {
428  return v.first;
429  }
430  static constexpr const key_type& get_key(const value_type& v)
431  {
432  return v.first;
433  }
434  static constexpr const key_type& get_key(const key_type& v)
435  {
436  return v;
437  }
438  static constexpr value_type construct(const init_type& v)
439  {
440  return value_type{ v.first, v.second };
441  }
442  };
443 
444  template<typename _T1, typename _T2>
446  {
452 
454  using hash_type = typename HT1::hash_type;
455  using init_key_type = typename HT1::init_type;
456  using key_type = typename HT1::value_type;
457 
458  static constexpr hash_type get_init_hash(const init_type& v)
459  {
460  return v.second;
461  }
462  static constexpr const key_type& get_key(const value_type& v)
463  {
464  return v.first;
465  }
466  static constexpr const key_type& get_key(const key_type& v)
467  {
468  return v;
469  }
470  static constexpr value_type construct(const init_type& v)
471  {
472  return value_type{ v.second, v.first };
473  }
474  };
475 
476  // This is 'contained' backend for binary search containers, it can be beared with it's owning class
477  template<typename _ProxyType>
479  {};
480 
481  template<typename _SizeType, typename _ArrayType>
482  class simple_backend<std::pair<_SizeType, _ArrayType>>
483  {
484  public:
485  constexpr simple_backend() = default;
486 
488 
489  constexpr simple_backend(const std::pair<_SizeType, _ArrayType>& init)
490  : m_array { std::get<1>(init) },
491  m_realsize { std::get<0>(init) }
492  {}
493 
494  static constexpr auto capacity = array_size<_ArrayType>::value;
495  constexpr auto realsize() const noexcept { return m_realsize; }
496  constexpr auto indexsize() const noexcept { return m_realsize; }
497  constexpr auto get_values() const noexcept { return m_array.data(); }
498  constexpr auto get_index() const noexcept { return m_array.data(); }
499  private:
500  _ArrayType m_array;
501  std::size_t m_realsize{0};
502  };
503 
504  template<typename _SizeType, typename _ArrayType, typename _IndexType>
505  class simple_backend<std::tuple<_SizeType, _ArrayType, _IndexType>>
506  {
507  public:
510  using tuple_type = std::tuple<_SizeType, _ArrayType, _IndexType>;
511 
512  static constexpr auto capacity = array_size<_ArrayType>::value;
513 
514  constexpr simple_backend() = default;
515 
516  constexpr simple_backend(const tuple_type& init)
517  : m_index { std::get<2>(init) },
518  m_array { std::get<1>(init) },
519  m_realsize { std::get<0>(init) }
520  {}
521 
522  constexpr auto realsize() const noexcept { return m_realsize; }
523  constexpr auto indexsize() const noexcept { return m_realsize; }
524  constexpr auto get_values() const noexcept { return m_array.data(); }
525  constexpr auto get_index() const noexcept { return m_index.data(); }
526  private:
527  _IndexType m_index{}; // index is first because it can be aligned
528  _ArrayType m_array{};
529  _SizeType m_realsize{0};
530  };
531 
532  template<typename _ArrayType>
534  {
535  public:
538 
539  constexpr presorted_backend() = default;
540  constexpr presorted_backend(const _ArrayType& _Other)
541  : m_vec{_Other}
542  {}
543 
544  constexpr auto get_values() const noexcept { return m_vec.data(); }
545  constexpr auto get_index() const noexcept { return m_vec.data(); }
546  constexpr size_t realsize() const noexcept { return m_vec.size(); }
547 
548  private:
549  _ArrayType m_vec;
550  };
551 
552  // This is 'referring' backend of fixed size, it points to a external data
553  template<typename _IndexType, typename _ValueType>
555  {
556  public:
557  constexpr portable_backend() = default;
558 
559  using index_type = _IndexType;
560  using value_type = _ValueType;
561 
562  template<typename _ArrayType>
564  : m_values { _Other.get_values(), _Other.realsize() },
565  m_index { _Other.get_index(), _Other.realsize() }
566  {}
567 
568  constexpr auto get_values() const noexcept { return m_values.data(); }
569  constexpr auto get_index() const noexcept { return m_index.data(); }
570  constexpr size_t realsize() const noexcept { return m_values.size(); }
571  private:
574  };
575 
576 
577  template<typename _Traits, typename _Backend, typename _Duplicates = tag_DuplicatesNo>
579  {
580  public:
581  // standard definitions
582  using value_type = typename _Traits::value_type;
583  using size_type = std::size_t;
584  using difference_type = std::ptrdiff_t;
585  using reference = const value_type&;
586  using const_reference = const value_type&;
587  using pointer = const value_type*;
588  using const_pointer = const value_type*;
589  using iterator = const value_type*;
590  using const_iterator = const value_type*;
591  using reverse_iterator = std::reverse_iterator<iterator>;
592  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
593 
594  // non-standard definitions
595  using traits_type = _Traits;
596  friend class const_set_map_base<_Traits, void, _Duplicates>;
597 
598  using hash_type = typename _Traits::hash_type;
599  using intermediate = typename _Traits::key_type;
600  using init_key_type = typename _Traits::init_key_type;
601  using init_type = typename _Traits::init_type;
603 
604  static constexpr bool can_index = sorter_type::can_index;
605 
606  using index_type = std::conditional_t<
607  can_index,
608  hash_type,
609  typename _Traits::value_type>;
610 
613  _Backend>;
614 
615  // standard methods
616 
617  constexpr size_type size() const noexcept { return m_backend.realsize(); }
618  constexpr size_type max_size() const noexcept { return size(); }
619  constexpr size_type capacity() const noexcept { return m_backend.capacity(); }
620  constexpr bool empty() const noexcept { return size() == 0; }
621  constexpr const_iterator begin() const noexcept { return m_backend.get_values(); }
622  constexpr const_iterator cbegin() const noexcept { return begin(); }
623  constexpr const_iterator end() const noexcept { return begin() + m_backend.realsize(); }
624  constexpr const_iterator cend() const noexcept { return end(); }
625  constexpr const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator{ end() }; }
626  constexpr const_reverse_iterator rcbegin() const noexcept { return rbegin(); }
627  constexpr const_reverse_iterator rend() const noexcept { return const_reverse_iterator{ begin() }; }
628  constexpr const_reverse_iterator rcend() const noexcept { return rend(); }
629 
630  using key_compare = typename _Traits::hashed_key_type::value_compare;
631 
633  {
634  constexpr bool operator()( const value_type& l, const value_type& r ) const
635  {
636  return key_compare{}(_Traits::get_key(l), _Traits::get_key(r));
637  }
638  };
639 
641  {
642  template<typename _TL, typename _TR>
643  constexpr bool operator()(const _TL & l, const _TR & r ) const
644  {
645  return typename _Traits::hashed_key_type::hash_compare{}(_Traits::get_key(l), _Traits::get_key(r));
646  }
647  };
648 
650  {
651  init_key_type key{_key};
652  hash_type hash{key};
653  auto it = std::lower_bound(m_backend.get_index(), m_backend.get_index()+m_backend.realsize(), hash, hash_compare{});
654  auto offset = std::distance(m_backend.get_index(), it);
655  return begin() + offset;
656  }
658  {
659  init_key_type key{_key};
660  hash_type hash{key};
661  auto it = std::upper_bound(m_backend.get_index(), m_backend.get_index()+m_backend.realsize(), hash, hash_compare{});
662  auto offset = std::distance(m_backend.get_index(), it);
663  return begin() + offset;
664  }
665  std::pair<const_iterator, const_iterator>
667  {
668  init_key_type key{_key};
669  hash_type hash{key};
670  auto _range = std::equal_range(m_backend.get_index(), m_backend.get_index()+m_backend.realsize(), hash, hash_compare{});
671  return std::make_pair(
672  begin() + std::distance(m_backend.get_index(), _range.first),
673  begin() + std::distance(m_backend.get_index(), _range.second));
674  }
675 
677  {
678  auto it = lower_bound(_key);
679  if (it == end() || key_compare{}(_key, _Traits::get_key(*it)))
680  return end();
681  else
682  return it;
683  }
684 
685  size_t get_alignment() const
686  { // debug method for unit tests
687  return std::uintptr_t(m_backend.get_index()) % std::hardware_constructive_interference_size;
688  }
689 
690  // debug method for unit tests
691  const auto& get_backend() const noexcept { return m_backend; }
692 
693  static constexpr bool is_presorted = std::is_same_v<presorted_backend<const_vector<typename _Traits::value_type>>, backend_type>;
694 
695  constexpr const_set_map_base() = default;
696 
697  constexpr const_set_map_base(const backend_type& backend)
698  : m_backend{ backend }
699  {}
700 
701  template<
702  typename _Other,
703  typename _NotUsed = std::enable_if_t<
705  std::is_constructible<backend_type, typename _Other::backend_type
706  >::value>
707  >
708  constexpr const_set_map_base(const _Other& _other)
709  : m_backend{ _other.m_backend }
710  {}
711 
712  protected:
713 
714  template<typename _ArrayType>
715  static constexpr auto make_backend(const _ArrayType& init)
716  {
717  auto proxy = sorter_type::sort(init);
718  using backend_type = simple_backend<decltype(proxy)>;
719  return backend_type{proxy};
720  }
721 
722  template<typename _ArrayType>
723  static constexpr auto presorted(const _ArrayType& init)
724  {
726  return backend_type{init};
727  }
728 
730  };
731 
732 }
733 
734 namespace std
735 {
736  template<typename...TArgs>
737  constexpr size_t size(const compile_time_bits::const_set_map_base<TArgs...>& _container)
738  {
739  return _container.size();
740  }
741 }
742 
743 #include "ctsort_cxx14.hpp"
744 
745 #include "ct_crc32.hpp"
746 
747 
748 
749 #endif
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
static constexpr auto sort(_Init &&init) noexcept
static constexpr bool can_index
constexpr bool empty() const noexcept
constexpr const_reverse_iterator rcend() const noexcept
const_iterator lower_bound(intermediate _key) const
constexpr size_type capacity() const noexcept
std::pair< const_iterator, const_iterator > equal_range(intermediate _key) const
constexpr const_iterator begin() const noexcept
static constexpr auto make_backend(const _ArrayType &init)
constexpr size_type size() const noexcept
constexpr const_reverse_iterator rbegin() const noexcept
constexpr const_iterator end() const noexcept
constexpr const_iterator cbegin() const noexcept
constexpr const_iterator cend() const noexcept
const_iterator upper_bound(intermediate _key) const
constexpr const_reverse_iterator rend() const noexcept
const auto & get_backend() const noexcept
constexpr const_set_map_base(const _Other &_other)
constexpr size_type max_size() const noexcept
std::conditional_t< std::is_void< void >::value, portable_backend< index_type, value_type >, void > backend_type
constexpr const_reverse_iterator rcbegin() const noexcept
static constexpr auto presorted(const _ArrayType &init)
const_iterator find(intermediate _key) const
std::conditional_t< can_index, hash_type, typename _Traits::value_type > index_type
constexpr const_set_map_base()=default
constexpr const_set_map_base(const backend_type &backend)
constexpr size_type size() const noexcept
constexpr const_iterator begin() const noexcept
constexpr size_type max_size() const noexcept
constexpr const_vector(value_type const (&init)[N])
constexpr const_reverse_iterator rbegin() const noexcept
constexpr const_iterator cend() const noexcept
constexpr const_reverse_iterator rcbegin() const noexcept
constexpr const_reference front() const
constexpr bool empty() const noexcept
constexpr size_type capacity() const noexcept
constexpr const_reference at(size_t index) const
constexpr const_vector(const_pointer data, size_t size)
constexpr const_reverse_iterator rcend() const noexcept
constexpr const_reverse_iterator rend() const noexcept
constexpr const_vector(std::nullptr_t)
constexpr const_pointer data() const noexcept
constexpr const_iterator cbegin() const noexcept
constexpr const_vector(const std::array< value_type, N > &data)
constexpr const_iterator end() const noexcept
constexpr const_reference operator[](size_t index) const
constexpr const_reference back() const
constexpr const_vector()=default
const_vector< index_type > m_index
constexpr auto get_index() const noexcept
constexpr auto get_values() const noexcept
constexpr size_t realsize() const noexcept
const_vector< value_type > m_values
constexpr portable_backend()=default
constexpr portable_backend(const simple_backend< _ArrayType > &_Other)
typename _ArrayType::value_type value_type
constexpr auto get_index() const noexcept
constexpr presorted_backend(const _ArrayType &_Other)
typename _ArrayType::value_type index_type
constexpr size_t realsize() const noexcept
constexpr presorted_backend()=default
constexpr auto get_values() const noexcept
constexpr simple_backend(const std::pair< _SizeType, _ArrayType > &init)
constexpr size_t hardware_destructive_interference_size
constexpr std::underlying_type_t< Enum > to_underlying(Enum e) noexcept
typename remove_cvref< T >::type remove_cvref_t
constexpr size_t hardware_constructive_interference_size
#define T(s)
Definition: common.h:230
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:40
static int type
Definition: getdata.c:31
int offset
Definition: replacements.h:160
unsigned int uintptr_t
Definition: ncbitype.h:197
typename real_underlying_type< T >::type real_underlying_type_t
constexpr real_underlying_type_t< Enum > to_real_underlying(Enum e) noexcept
constexpr auto to_array_impl(T &&a, std::index_sequence< I... >) -> std::array< _Elem, N >
std::integral_constant< ncbi::NStr::ECase, ncbi::NStr::eCase > tagStrCase
constexpr size_t get_array_size(T &&)
std::false_type tag_DuplicatesNo
typename array_elem< T >::type array_elem_t
constexpr auto make_array(T &&a)
std::true_type tag_DuplicatesYes
std::false_type tag_SortByValues
std::integral_constant< ncbi::NStr::ECase, ncbi::NStr::eNocase > tagStrNocase
std::true_type tag_SortByHashes
double value_type
The numeric datatype used by the parser.
Definition: muParserDef.h:228
const struct ncbi::grid::netcache::search::fields::KEY key
Magic spell ;-) needed for some weird compilers... very empiric.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
unsigned int a
Definition: ncbi_localip.c:102
const char * tag
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
std::pair< typename DeduceType< _Types >::init_type... > init_type
std::pair< typename DeduceType< _Types >::value_type... > value_type
std::tuple< typename DeduceType< _Types >::value_type... > value_type
std::tuple< typename DeduceType< _Types >::init_type... > init_type
ct_basic_string< _CharType > view
constexpr bool operator()(const _TL &l, const _TR &r) const
constexpr bool operator()(const value_type &l, const value_type &r) const
typename straight_map_traits< _T1, _T2 >::init_type init_type
static constexpr const key_type & get_key(const key_type &v)
typename pair_type::value_type value_type
static constexpr value_type construct(const init_type &v)
static constexpr hash_type get_init_hash(const init_type &v)
static constexpr const key_type & get_key(const value_type &v)
typename hashed_key_type::init_type init_type
static constexpr hash_type get_init_hash(const init_type &v)
typename hashed_key_type::init_type init_key_type
static constexpr const key_type & get_key(const value_type &v)
typename hashed_key_type::hash_type hash_type
typename hashed_key_type::value_type key_type
static constexpr value_type construct(const init_type &v)
typename hashed_key_type::value_type value_type
static constexpr const key_type & get_key(const value_type &v)
static constexpr value_type construct(const init_type &v)
static constexpr hash_type get_init_hash(const init_type &v)
static constexpr const key_type & get_key(const key_type &v)
typename pair_type::init_type init_type
typename pair_type::value_type value_type
Definition: _hash_fun.h:40
std::remove_cv_t< std::remove_reference_t< T > > type
Definition: type.c:6
#define const
Definition: zconf.h:232
#define N
Definition: crc32.c:57
Modified on Wed Apr 17 13:09:49 2024 by modify_doxy.py rev. 669887