Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:49:46

0001 #ifndef BOOST_QVM_ENABLE_IF_HPP_INCLUDED
0002 #define BOOST_QVM_ENABLE_IF_HPP_INCLUDED
0003 
0004 // Copyright 2008-2024 Emil Dotchevski and Reverge Studios, Inc.
0005 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0006 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 
0008 // Boost enable_if library
0009 
0010 // Copyright 2003 (c) The Trustees of Indiana University.
0011 
0012 //    Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
0013 //             Jeremiah Willcock (jewillco at osl.iu.edu)
0014 //             Andrew Lumsdaine (lums at osl.iu.edu)
0015 
0016 namespace boost { namespace qvm {
0017 
0018   template<typename T, typename R=void>
0019   struct enable_if_has_type
0020   {
0021     typedef R type;
0022   };
0023 
0024   template <bool B, class T = void>
0025   struct enable_if_c {
0026     typedef T type;
0027   };
0028 
0029   template <class T>
0030   struct enable_if_c<false, T> {};
0031 
0032   template <class Cond, class T = void>
0033   struct enable_if : public enable_if_c<Cond::value, T> {};
0034 
0035   template <bool B, class T>
0036   struct lazy_enable_if_c {
0037     typedef typename T::type type;
0038   };
0039 
0040   template <class T>
0041   struct lazy_enable_if_c<false, T> {};
0042 
0043   template <class Cond, class T>
0044   struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
0045 
0046 
0047   template <bool B, class T = void>
0048   struct disable_if_c {
0049     typedef T type;
0050   };
0051 
0052   template <class T>
0053   struct disable_if_c<true, T> {};
0054 
0055   template <class Cond, class T = void>
0056   struct disable_if : public disable_if_c<Cond::value, T> {};
0057 
0058   template <bool B, class T>
0059   struct lazy_disable_if_c {
0060     typedef typename T::type type;
0061   };
0062 
0063   template <class T>
0064   struct lazy_disable_if_c<true, T> {};
0065 
0066   template <class Cond, class T>
0067   struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
0068 
0069 ////////////////////////////////////////////////
0070 
0071   // The types below are a copy of the original types above, to workaround MSVC-12 bugs.
0072 
0073   template<typename T, typename R=void>
0074   struct enable_if_has_type2
0075   {
0076     typedef R type;
0077   };
0078 
0079   template <bool B, class T = void>
0080   struct enable_if_c2 {
0081     typedef T type;
0082   };
0083 
0084   template <class T>
0085   struct enable_if_c2<false, T> {};
0086 
0087   template <class Cond, class T = void>
0088   struct enable_if2 : public enable_if_c2<Cond::value, T> {};
0089 
0090   template <bool B, class T>
0091   struct lazy_enable_if_c2 {
0092     typedef typename T::type type;
0093   };
0094 
0095   template <class T>
0096   struct lazy_enable_if_c2<false, T> {};
0097 
0098   template <class Cond, class T>
0099   struct lazy_enable_if2 : public lazy_enable_if_c2<Cond::value, T> {};
0100 
0101 
0102   template <bool B, class T = void>
0103   struct disable_if_c2 {
0104     typedef T type;
0105   };
0106 
0107   template <class T>
0108   struct disable_if_c2<true, T> {};
0109 
0110   template <class Cond, class T = void>
0111   struct disable_if2 : public disable_if_c2<Cond::value, T> {};
0112 
0113   template <bool B, class T>
0114   struct lazy_disable_if_c2 {
0115     typedef typename T::type type;
0116   };
0117 
0118   template <class T>
0119   struct lazy_disable_if_c2<true, T> {};
0120 
0121   template <class Cond, class T>
0122   struct lazy_disable_if2 : public lazy_disable_if_c2<Cond::value, T> {};
0123 
0124 } }
0125 
0126 #endif