BVB Source Codes

mars Show meta_utils_core.hpp Source code

Return Download mars: download meta_utils_core.hpp Source code - Download mars Source code - Type:.hpp
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2015-2015.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/move for documentation.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11.  
  12. //! \file
  13.  
  14. #ifndef BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
  15. #define BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
  16.  
  17. #ifndef BOOST_CONFIG_HPP
  18. #  include <boost/config.hpp>
  19. #endif
  20. #
  21. #if defined(BOOST_HAS_PRAGMA_ONCE)
  22. #  pragma once
  23. #endif
  24.  
  25. //Small meta-typetraits to support move
  26.  
  27. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  28. namespace move_detail {
  29.  
  30. //////////////////////////////////////
  31. //             if_c
  32. //////////////////////////////////////
  33. template<bool C, typename T1, typename T2>
  34. struct if_c
  35. {
  36.    typedef T1 type;
  37. };
  38.  
  39. template<typename T1, typename T2>
  40. struct if_c<false,T1,T2>
  41. {
  42.    typedef T2 type;
  43. };
  44.  
  45. //////////////////////////////////////
  46. //             if_
  47. //////////////////////////////////////
  48. template<typename T1, typename T2, typename T3>
  49. struct if_ : if_c<0 != T1::value, T2, T3>
  50. {};
  51.  
  52. //////////////////////////////////////
  53. //          enable_if_c
  54. //////////////////////////////////////
  55. template <bool B, class T = void>
  56. struct enable_if_c
  57. {
  58.    typedef T type;
  59. };
  60.  
  61. template <class T>
  62. struct enable_if_c<false, T> {};
  63.  
  64. //////////////////////////////////////
  65. //           enable_if
  66. //////////////////////////////////////
  67. template <class Cond, class T = void>
  68. struct enable_if : enable_if_c<Cond::value, T> {};
  69.  
  70. //////////////////////////////////////
  71. //          disable_if_c
  72. //////////////////////////////////////
  73. template <bool B, class T = void>
  74. struct disable_if_c
  75.    : enable_if_c<!B, T>
  76. {};
  77.  
  78. //////////////////////////////////////
  79. //          disable_if
  80. //////////////////////////////////////
  81. template <class Cond, class T = void>
  82. struct disable_if : enable_if_c<!Cond::value, T> {};
  83.  
  84. //////////////////////////////////////
  85. //          integral_constant
  86. //////////////////////////////////////
  87. template<class T, T v>
  88. struct integral_constant
  89. {
  90.    static const T value = v;
  91.    typedef T value_type;
  92.    typedef integral_constant<T, v> type;
  93.  
  94.      operator T() const { return value; }
  95.    T operator()() const { return value; }
  96. };
  97.  
  98. typedef integral_constant<bool, true >  true_type;
  99. typedef integral_constant<bool, false > false_type;
  100.  
  101.  
  102. //////////////////////////////////////
  103. //             is_same
  104. //////////////////////////////////////
  105. template<class T, class U>
  106. struct is_same
  107. {
  108.    static const bool value = false;
  109. };
  110.  
  111. template<class T>
  112. struct is_same<T, T>
  113. {
  114.    static const bool value = true;
  115. };
  116.  
  117. }  //namespace move_detail {
  118. }  //namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  119.  
  120. #endif //#ifndef BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
  121.  
downloadmeta_utils_core.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top