BVB Source Codes

mars Show enable_if.hpp Source code

Return Download mars: download enable_if.hpp Source code - Download mars Source code - Type:.hpp
  1. // Boost enable_if library
  2.  
  3. // Copyright 2003 (c) The Trustees of Indiana University.
  4.  
  5. // Use, modification, and distribution is subject to the Boost Software
  6. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8.  
  9. //    Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
  10. //             Jeremiah Willcock (jewillco at osl.iu.edu)
  11. //             Andrew Lumsdaine (lums at osl.iu.edu)
  12.  
  13.  
  14. #ifndef BOOST_CORE_ENABLE_IF_HPP
  15. #define BOOST_CORE_ENABLE_IF_HPP
  16.  
  17. #include "boost/config.hpp"
  18.  
  19. // Even the definition of enable_if causes problems on some compilers,
  20. // so it's macroed out for all compilers that do not support SFINAE
  21.  
  22. #ifndef BOOST_NO_SFINAE
  23.  
  24. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost
  25. {
  26.   template<typename T, typename R=void>
  27.   struct enable_if_has_type
  28.   {
  29.     typedef R type;
  30.   };
  31.  
  32.   template <bool B, class T = void>
  33.   struct enable_if_c {
  34.     typedef T type;
  35.   };
  36.  
  37.   template <class T>
  38.   struct enable_if_c<false, T> {};
  39.  
  40.   template <class Cond, class T = void>
  41.   struct enable_if : public enable_if_c<Cond::value, T> {};
  42.  
  43.   template <bool B, class T>
  44.   struct lazy_enable_if_c {
  45.     typedef typename T::type type;
  46.   };
  47.  
  48.   template <class T>
  49.   struct lazy_enable_if_c<false, T> {};
  50.  
  51.   template <class Cond, class T>
  52.   struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
  53.  
  54.  
  55.   template <bool B, class T = void>
  56.   struct disable_if_c {
  57.     typedef T type;
  58.   };
  59.  
  60.   template <class T>
  61.   struct disable_if_c<true, T> {};
  62.  
  63.   template <class Cond, class T = void>
  64.   struct disable_if : public disable_if_c<Cond::value, T> {};
  65.  
  66.   template <bool B, class T>
  67.   struct lazy_disable_if_c {
  68.     typedef typename T::type type;
  69.   };
  70.  
  71.   template <class T>
  72.   struct lazy_disable_if_c<true, T> {};
  73.  
  74.   template <class Cond, class T>
  75.   struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
  76.  
  77. } // namespace mars_boost
  78.  
  79. #else
  80.  
  81. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  82.  
  83.   namespace detail { typedef void enable_if_default_T; }
  84.  
  85.   template <typename T>
  86.   struct enable_if_does_not_work_on_this_compiler;
  87.  
  88.   template<typename T, typename R=void>
  89.   struct enable_if_has_type : enable_if_does_not_work_on_this_compiler<T>
  90.   { };
  91.  
  92.   template <bool B, class T = detail::enable_if_default_T>
  93.   struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
  94.   { };
  95.  
  96.   template <bool B, class T = detail::enable_if_default_T>
  97.   struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
  98.   { };
  99.  
  100.   template <bool B, class T = detail::enable_if_default_T>
  101.   struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
  102.   { };
  103.  
  104.   template <bool B, class T = detail::enable_if_default_T>
  105.   struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
  106.   { };
  107.  
  108.   template <class Cond, class T = detail::enable_if_default_T>
  109.   struct enable_if : enable_if_does_not_work_on_this_compiler<T>
  110.   { };
  111.  
  112.   template <class Cond, class T = detail::enable_if_default_T>
  113.   struct disable_if : enable_if_does_not_work_on_this_compiler<T>
  114.   { };
  115.  
  116.   template <class Cond, class T = detail::enable_if_default_T>
  117.   struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
  118.   { };
  119.  
  120.   template <class Cond, class T = detail::enable_if_default_T>
  121.   struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
  122.   { };
  123.  
  124. } // namespace mars_boost
  125.  
  126. #endif // BOOST_NO_SFINAE
  127.  
  128. #endif
  129.  
downloadenable_if.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