Micro template library A library for building device drivers
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

134 satır
11 KiB

  1. \hypertarget{operations_8h}{}\section{include/utl/meta/operations.h File Reference}
  2. \label{operations_8h}\index{include/utl/meta/operations.\+h@{include/utl/meta/operations.\+h}}
  3. Integral constant operations and logical operations.
  4. {\ttfamily \#include $<$utl/core/impl.\+h$>$}\newline
  5. {\ttfamily \#include $<$utl/meta/selection.\+h$>$}\newline
  6. \subsection*{Classes}
  7. \begin{DoxyCompactItemize}
  8. \item
  9. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__or__}{utl\+::meta\+::detail\+::\+\_\+or\+\_\+$<$... $>$}}
  10. \item
  11. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__or___3_4}{utl\+::meta\+::detail\+::\+\_\+or\+\_\+$<$$>$}}
  12. \item
  13. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__or___3_01___t1_01_4}{utl\+::meta\+::detail\+::\+\_\+or\+\_\+$<$ \+\_\+\+T1 $>$}}
  14. \item
  15. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__or___3_01___t1_00_01___t2_01_4}{utl\+::meta\+::detail\+::\+\_\+or\+\_\+$<$ \+\_\+\+T1, \+\_\+\+T2 $>$}}
  16. \item
  17. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__or___3_01___t1_00_01___t2_00_01___t3_00_01___tn_8_8_8_01_4}{utl\+::meta\+::detail\+::\+\_\+or\+\_\+$<$ \+\_\+\+T1, \+\_\+\+T2, \+\_\+\+T3, \+\_\+\+Tn... $>$}}
  18. \item
  19. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__and__}{utl\+::meta\+::detail\+::\+\_\+and\+\_\+$<$... $>$}}
  20. \item
  21. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__and___3_4}{utl\+::meta\+::detail\+::\+\_\+and\+\_\+$<$$>$}}
  22. \item
  23. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__and___3_01___t1_01_4}{utl\+::meta\+::detail\+::\+\_\+and\+\_\+$<$ \+\_\+\+T1 $>$}}
  24. \item
  25. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__and___3_01___t1_00_01___t2_01_4}{utl\+::meta\+::detail\+::\+\_\+and\+\_\+$<$ \+\_\+\+T1, \+\_\+\+T2 $>$}}
  26. \item
  27. struct \mbox{\hyperlink{structutl_1_1meta_1_1detail_1_1__and___3_01___t1_00_01___t2_00_01___t3_00_01___tn_8_8_8_01_4}{utl\+::meta\+::detail\+::\+\_\+and\+\_\+$<$ \+\_\+\+T1, \+\_\+\+T2, \+\_\+\+T3, \+\_\+\+Tn... $>$}}
  28. \item
  29. struct \mbox{\hyperlink{structutl_1_1meta_1_1same__}{utl\+::meta\+::same\+\_\+$<$ \+\_\+\+T1, \+\_\+\+T2 $>$}}
  30. \item
  31. struct \mbox{\hyperlink{structutl_1_1meta_1_1same___3_01___tp_00_01___tp_01_4}{utl\+::meta\+::same\+\_\+$<$ \+\_\+\+Tp, \+\_\+\+Tp $>$}}
  32. \end{DoxyCompactItemize}
  33. \subsection*{Namespaces}
  34. \begin{DoxyCompactItemize}
  35. \item
  36. \mbox{\hyperlink{namespaceutl}{utl}}
  37. \begin{DoxyCompactList}\small\item\em S\+TL\textquotesingle{}s core language concepts. \end{DoxyCompactList}\item
  38. \mbox{\hyperlink{namespaceutl_1_1meta}{utl\+::meta}}
  39. \item
  40. \mbox{\hyperlink{namespaceutl_1_1meta_1_1detail}{utl\+::meta\+::detail}}
  41. \end{DoxyCompactItemize}
  42. \subsection*{Typedefs}
  43. \begin{DoxyCompactItemize}
  44. \item
  45. {\footnotesize template$<$bool B$>$ }\\using \mbox{\hyperlink{group__integral_ga7de987520bd0973f03ff8bab3152361a}{utl\+::meta\+::not\+\_\+c}} = bool\+\_\+$<$!B $>$
  46. \begin{DoxyCompactList}\small\item\em Negate the {\itshape bool} constant parameter. \end{DoxyCompactList}\item
  47. {\footnotesize template$<$typename \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{group__integral_ga16df145331d3c62e624385c5949d90c4}{utl\+::meta\+::not\+\_\+}} = not\+\_\+c$<$ \+\_\+\+Tp\+::type\+::value $>$
  48. \begin{DoxyCompactList}\small\item\em not \end{DoxyCompactList}\end{DoxyCompactItemize}
  49. \textbf{ }\par
  50. \begin{DoxyCompactItemize}
  51. \item
  52. {\footnotesize template$<$typename... \+\_\+\+Ts$>$ }\\using \mbox{\hyperlink{group__integral_gac43f400cc93d54f5f79892e618069d9b}{utl\+::meta\+::or\+\_\+}} = eval$<$ detail\+::\+\_\+or\+\_\+$<$ \+\_\+\+Ts... $>$ $>$
  53. \end{DoxyCompactItemize}
  54. \textbf{ }\par
  55. \begin{DoxyCompactItemize}
  56. \item
  57. {\footnotesize template$<$typename... \+\_\+\+Ts$>$ }\\using \mbox{\hyperlink{group__integral_ga8e82f4758321e0e0b3705607f7d8e068}{utl\+::meta\+::and\+\_\+}} = eval$<$ detail\+::\+\_\+and\+\_\+$<$ \+\_\+\+Ts... $>$ $>$
  58. \end{DoxyCompactItemize}
  59. \textbf{ }\par
  60. \begin{DoxyCompactItemize}
  61. \item
  62. {\footnotesize template$<$typename \+\_\+\+T1 , typename \+\_\+\+T2 $>$ }\\using \mbox{\hyperlink{group__integral_ga4dfaf054d891eb35d741662b077bbbd2}{utl\+::meta\+::not\+\_\+same\+\_\+}} = not\+\_\+$<$ eval$<$ same\+\_\+$<$ \+\_\+\+T1, \+\_\+\+T2 $>$ $>$$>$
  63. \end{DoxyCompactItemize}
  64. \textbf{ }\par
  65. \begin{DoxyCompactItemize}
  66. \item
  67. {\footnotesize template$<$typename \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_aec4bf9329ff8356d333a59e3c369d0b7}{utl\+::meta\+::negate}} = integral\+\_\+$<$ decltype(-\/\+\_\+\+Tp()), -\/\+\_\+\+Tp()$>$
  68. \begin{DoxyCompactList}\small\item\em Negation. \end{DoxyCompactList}\item
  69. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a559ad95ef39fd2c81664bd1a22dd99c1}{utl\+::meta\+::add}} = integral\+\_\+$<$ decltype(\+\_\+\+Tp1()+\+\_\+\+Tp2()), \+\_\+\+Tp1()+\+\_\+\+Tp2() $>$
  70. \begin{DoxyCompactList}\small\item\em Addition. \end{DoxyCompactList}\item
  71. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a5f0a890cbd116d4a72a760a26f5a8244}{utl\+::meta\+::mult}} = integral\+\_\+$<$ decltype(\+\_\+\+Tp2() $\ast$\+\_\+\+Tp2()), \+\_\+\+Tp1() $\ast$\+\_\+\+Tp2() $>$
  72. \begin{DoxyCompactList}\small\item\em Multiplication. \end{DoxyCompactList}\item
  73. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_ae1ec6fc1f76abbb2e5287aa91cd85068}{utl\+::meta\+::divide}} = integral\+\_\+$<$ decltype(\+\_\+\+Tp2()/\+\_\+\+Tp2()), \+\_\+\+Tp1()/\+\_\+\+Tp2() $>$
  74. \begin{DoxyCompactList}\small\item\em Division. \end{DoxyCompactList}\item
  75. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_adf7106374b1acc978be05b5848002cfc}{utl\+::meta\+::modulo}} = integral\+\_\+$<$ decltype(\+\_\+\+Tp1() \% \+\_\+\+Tp2()), \+\_\+\+Tp1() \% \+\_\+\+Tp2() $>$
  76. \begin{DoxyCompactList}\small\item\em Modulo. \end{DoxyCompactList}\item
  77. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a9f90eea3852367afa4e1fe74756976fb}{utl\+::meta\+::sub}} = add$<$ \+\_\+\+Tp1, negate$<$ \+\_\+\+Tp2 $>$ $>$
  78. \begin{DoxyCompactList}\small\item\em Substruction. \end{DoxyCompactList}\item
  79. {\footnotesize template$<$typename \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_af74f5af58b33241f1b94102742a73ab1}{utl\+::meta\+::inc}} = add$<$ \+\_\+\+Tp, int\+\_\+$<$ 1 $>$ $>$
  80. \begin{DoxyCompactList}\small\item\em Increase. \end{DoxyCompactList}\item
  81. {\footnotesize template$<$typename \+\_\+\+Tp $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_abee96e75aadb364fdd0890aa3ee490b7}{utl\+::meta\+::dec}} = add$<$ \+\_\+\+Tp, int\+\_\+$<$-\/1 $>$ $>$
  82. \begin{DoxyCompactList}\small\item\em decrease \end{DoxyCompactList}\end{DoxyCompactItemize}
  83. \textbf{ }\par
  84. \begin{DoxyCompactItemize}
  85. \item
  86. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a7ae2d08147055946f1b9345e579a26b6}{utl\+::meta\+::comp\+\_\+eq}} = bool\+\_\+$<$ \+\_\+\+Tp1()==\+\_\+\+Tp2()$>$
  87. \item
  88. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a1a948746d1758a05c0ae71cfd114b05d}{utl\+::meta\+::comp\+\_\+lt}} = bool\+\_\+$<$(\+\_\+\+Tp1()$<$ \+\_\+\+Tp2())$>$
  89. \item
  90. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_af92bee16de47b16ba01a8efac686b488}{utl\+::meta\+::comp\+\_\+ne}} = not\+\_\+$<$ comp\+\_\+eq$<$ \+\_\+\+Tp1, \+\_\+\+Tp2 $>$ $>$
  91. \begin{DoxyCompactList}\small\item\em Not equal. \end{DoxyCompactList}\item
  92. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a3c4784ad3eb1f745c58b9a4b65a406e8}{utl\+::meta\+::comp\+\_\+gt}} = comp\+\_\+lt$<$ \+\_\+\+Tp2, \+\_\+\+Tp1 $>$
  93. \begin{DoxyCompactList}\small\item\em Greater than. \end{DoxyCompactList}\item
  94. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_afb9a35dc5ef40b5bf9902c0daec7f1af}{utl\+::meta\+::comp\+\_\+le}} = not\+\_\+$<$ comp\+\_\+lt$<$ \+\_\+\+Tp2, \+\_\+\+Tp1 $>$ $>$
  95. \begin{DoxyCompactList}\small\item\em Less or equal. \end{DoxyCompactList}\item
  96. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_ae6c552e8e99ac5578f865f17c1d0efdc}{utl\+::meta\+::comp\+\_\+ge}} = not\+\_\+$<$ comp\+\_\+lt$<$ \+\_\+\+Tp1, \+\_\+\+Tp2 $>$ $>$
  97. \begin{DoxyCompactList}\small\item\em Greater or equal. \end{DoxyCompactList}\end{DoxyCompactItemize}
  98. \textbf{ }\par
  99. \begin{DoxyCompactItemize}
  100. \item
  101. {\footnotesize template$<$typename \+\_\+T $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a9ea199752ca985d1b813d7127868566c}{utl\+::meta\+::bitnot\+\_\+}} = integral\+\_\+$<$ typename \+\_\+\+T\+::value\+\_\+type,(typename \+\_\+\+T\+::value\+\_\+type)($\sim$\+\_\+T())$>$
  102. \item
  103. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_aca6b42898b47945118c518bde9d25cc2}{utl\+::meta\+::bitand\+\_\+}} = integral\+\_\+$<$ decltype(\+\_\+\+Tp1() \&\+\_\+\+Tp2()), \+\_\+\+Tp1() \&\+\_\+\+Tp2()$>$
  104. \item
  105. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a1e2c2decdd22972fc8ce43203c0ef0d1}{utl\+::meta\+::bitor\+\_\+}} = integral\+\_\+$<$ decltype(\+\_\+\+Tp1()$\vert$\+\_\+\+Tp2()), \+\_\+\+Tp1()$\vert$\+\_\+\+Tp2()$>$
  106. \item
  107. {\footnotesize template$<$typename \+\_\+\+Tp1 , typename \+\_\+\+Tp2 $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a910e21345bc7e75dc7c0ceb4a4721754}{utl\+::meta\+::bitxor\+\_\+}} = integral\+\_\+$<$ decltype(\+\_\+\+Tp1() $^\wedge$ \+\_\+\+Tp2()), \+\_\+\+Tp1() $^\wedge$ \+\_\+\+Tp2()$>$
  108. \item
  109. {\footnotesize template$<$typename \+\_\+\+Tp , typename shift $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_a63088c29ac25eefda4189721e662b391}{utl\+::meta\+::shift\+\_\+left}} = integral\+\_\+$<$ typename \+\_\+\+Tp\+::value\+\_\+type,(typename \+\_\+\+Tp\+::value\+\_\+type)(\+\_\+\+Tp()$<$$<$ shift())$>$
  110. \item
  111. {\footnotesize template$<$typename \+\_\+\+Tp , typename shift $>$ }\\using \mbox{\hyperlink{namespaceutl_1_1meta_acbe6dd78c4a4230e92acc5ca86e3fcc7}{utl\+::meta\+::shift\+\_\+right}} = integral\+\_\+$<$ typename \+\_\+\+Tp\+::value\+\_\+type,(typename \+\_\+\+Tp\+::value\+\_\+type)(\+\_\+\+Tp() $>$ $>$ shift())$>$
  112. \end{DoxyCompactItemize}
  113. \subsection{Detailed Description}
  114. Integral constant operations and logical operations.
  115. Copyright (C) 2018-\/2019 Christos Choutouridis
  116. This program is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  117. This program is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU Lesser General Public License for more details.
  118. You should have received a copy of the G\+NU Lesser General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}.