Содержание
- 2. On topic Metafunctions using specializations Metafunctions using SFINAE Implementation of std::common_type
- 3. Template specialization template class container { T content{}; }; int main() { container cont1; container cont2;
- 4. Template specialization template class container { T content{}; }; int main() { container cont1; //OK container
- 5. Template specialization struct Special { Special(int){} Special() = delete; };
- 6. Template specialization struct Special { Special(int){} Special() = delete; }; template class container { T content{};
- 7. Template specialization struct Special { Special(int){} Special() = delete; }; template class container { T content{};
- 8. Template specialization struct Special { /* ... */ }; template class container { /* ... */
- 9. Template specialization struct Special { /* ... */ }; template class container { /* ... */
- 10. std::is_same template struct is_same { static const bool value = false; }; template struct is_same {
- 11. std::is_same template struct is_same { /* ... */ }; template struct is_same { /* ... */
- 12. std::is_same template struct is_same { /* ... */ }; template struct is_same { /* ... */
- 13. std::is_same template struct is_same { /* ... */ }; template struct is_same { /* ... */
- 14. std::remove_reference template struct remove_reference { using type = T; }; template struct remove_reference { using type
- 15. std::remove_reference template struct remove_reference { using type = T; }; template struct remove_reference { // If
- 16. std::remove_reference template struct remove_reference { using type = T; }; template struct remove_reference { // If
- 17. std::remove_reference template struct remove_reference { //Any other type (not reference) using type = T; }; template
- 18. std::remove_reference // is_same def // remove_reference def int main() { static_assert(is_same ::type, int>::value); static_assert(is_same ::type, char**>::value);
- 19. std::remove_reference //... template struct remove_reference { // If r-reference using type = T; }; //... int
- 20. std::remove_reference //... template struct remove_reference { // If l-reference using type = T; }; //... int
- 21. std::remove_reference //... template struct remove_reference { //Any other type (not reference) using type = T; };
- 22. std::is_const template struct is_const { static const bool value = false; }; template struct is_const {
- 23. std::is_function
- 24. std::is_function
- 25. std::is_function
- 26. std::is_function
- 27. std::is_function template struct is_function { static const bool value = not std::is_const ::value; }; template struct
- 28. std::is_function template struct is_function { static const bool value = not std::is_const ::value;//Only functions and references
- 29. std::is_function template struct is_function { static const bool value = not std::is_const ::value;//Only functions and references
- 30. std::is_function template struct is_function { static const bool value = not std::is_const ::value;//Only functions and references
- 31. std::is_function template struct is_function { static const bool value = not std::is_const ::value;//Only functions and references
- 32. std::is_function template struct is_function { static const bool value = not std::is_const ::value;//Only functions and references
- 33. std::is_function template struct is_function { static const bool value = not std::is_const ::value;//Only functions and references
- 34. template struct is_function { static const bool value = not std::is_const ::value;//Only functions and references have
- 35. std::is_function template struct is_function { static const bool value = not std::is_const ::value; }; template struct
- 36. std::is_array template struct is_array { static const bool value = false; }; template struct is_array {
- 37. std::is_array template struct is_array { static const bool value = false; }; template struct is_array {
- 38. std::is_array template struct is_array { static const bool value = false; }; template struct is_array {
- 39. std::is_array template struct is_array { // Primary template for non-array types static const bool value =
- 40. std::remove_extent template struct remove_extent { using type = T; }; template struct remove_extent { using type
- 41. std::remove_extent template struct remove_extent { using type = T; }; template struct remove_extent { using type
- 42. std::remove_extent template struct remove_extent { using type = T; }; template struct remove_extent { using type
- 43. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 44. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 45. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 46. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 47. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 48. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 49. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 50. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 51. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 52. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 53. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 54. std::enable_if template struct enable_if; template struct enable_if { using type = IfTrue; }; template struct enable_if
- 55. SFINAE (Substitution Fail Is Not An Error)
- 56. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { std::cout }
- 57. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { std::cout }
- 58. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { std::cout }
- 59. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { std::cout }
- 60. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { //enable_if .
- 61. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { //enable_if .
- 62. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { std::cout }
- 63. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { // Substitution
- 64. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { // Substitution
- 65. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { // Substitution
- 66. SFINAE (Substitution Failure Is Not An Error) template std::enable_if_t , void> foo(const T&) { // Substitution
- 67. std::void_t template using void_t = void;
- 68. std::void_t template using void_t = void; static_assert(std::is_same_v {}.begin())>, void>);
- 69. std::is_defaut_constructible
- 70. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 71. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 72. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 73. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 74. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 75. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 76. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 77. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 78. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 79. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 80. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; //That’s it! }; template struct
- 81. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; //That’s it! }; template struct
- 82. std::is_defaut_constructible static_assert(is_constructible_impl , void, int*>::value);
- 83. std::is_defaut_constructible static_assert(is_constructible_impl , void, int*>::value); ???
- 84. std::is_defaut_constructible static_assert(is_constructible_impl , void, int*>::value); ???
- 85. std::is_defaut_constructible static_assert(is_constructible_impl , void, int*>::value); ??? template struct is_constructible : is_constructible_impl { };
- 86. std::is_defaut_constructible static_assert(is_constructible_impl , void, int*>::value); ??? template struct is_constructible : is_constructible_impl { }; static_assert(is_constructible , int*>::value);
- 87. std::is_defaut_constructible static_assert(is_constructible_impl , void, int*>::value); ??? template struct is_constructible : is_constructible_impl { }; static_assert(is_constructible , int*>::value);
- 88. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 89. std::declval template T&& declval() {};
- 90. std::declval template T&& declval() {}; static_assert(std::is_same_v ()),int&&>);
- 91. std::declval template T&& declval() {}; static_assert(std::is_same_v ()),int&&>); static_assert(std::is_same_v ()),char&>);
- 92. std::declval template T&& declval() {}; static_assert(std::is_same_v ()),int&&>); static_assert(std::is_same_v ()),char&>); static_assert(std::is_same_v decltype(std::declval >().begin()), std::vector ::iterator> );
- 93. std::declval template T&& declval() {}; static_assert(std::is_same_v ()),int&&>); static_assert(std::is_same_v ()),char&>); static_assert(std::is_same_v decltype(std::declval >().begin()), std::vector ::iterator> );
- 94. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ,
- 95. std::is_defaut_constructible template struct is_constructible_impl { static const bool value = false; }; template struct is_constructible_impl ()...))>,
- 96. std::common_type
- 97. std::common_type auto var = true ? bool{} : char{}; What is a type of `var`?
- 98. std::common_type auto var = true ? bool{} : char{}; // bool? What is a type of
- 99. std::common_type auto var = true ? bool{} : char{}; // bool? What is a type of
- 100. std::common_type auto var = true ? bool{} : char{}; // bool? What is a type of
- 101. std::common_type auto var = true ? bool{} : char{}; // bool? What is a type of
- 102. std::common_type How it works?
- 104. Скачать презентацию