MADNESS  version 0.9
type_traits.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31 
32  $Id: typestuff.h 2446 2011-07-22 15:21:22Z justus.c79@gmail.com $
33 */
34 
35 #include <madness/madness_config.h>
36 
37 #if defined(MADNESS_USE_TYPE_TRAITS)
38 # include <type_traits>
39 #elif defined(MADNESS_USE_TR1_TYPE_TRAITS)
40 # include <tr1/type_traits>
41 #elif defined(MADNESS_USE_BOOST_TR1_TYPE_TRAITS_HPP)
42 # include <boost/tr1/type_traits.hpp>
43 #else
44 # define MADNESS_HAS_STD_TYPE_TRAITS 1
46  namespace std {
60 
63 
71  }
72 #endif
73 
74 #if defined(MADNESS_HAS_STD_TR1_TYPE_TRAITS) && !defined(MADNESS_HAS_STD_TYPE_TRAITS)
75 #define MADNESS_HAS_STD_TYPE_TRAITS 1
76 
77 // Insert the tr1 type traits into the std namespace.
78 namespace std {
79  using ::std::tr1::integral_constant;
82  using ::std::tr1::is_void;
83  using ::std::tr1::is_integral;
84  using ::std::tr1::is_floating_point;
85  using ::std::tr1::is_array;
86  using ::std::tr1::is_pointer;
87  using ::std::tr1::is_reference;
88  using ::std::tr1::is_member_object_pointer;
89  using ::std::tr1::is_member_function_pointer;
90  using ::std::tr1::is_enum;
91  using ::std::tr1::is_union;
92  using ::std::tr1::is_class;
93  using ::std::tr1::is_function;
94  using ::std::tr1::is_arithmetic;
95  using ::std::tr1::is_fundamental;
96  using ::std::tr1::is_object;
97  using ::std::tr1::is_scalar;
98  using ::std::tr1::is_compound;
99  using ::std::tr1::is_member_pointer;
100  using ::std::tr1::is_const;
101  using ::std::tr1::is_volatile;
102  using ::std::tr1::is_pod;
103  using ::std::tr1::is_empty;
104  using ::std::tr1::is_polymorphic;
105  using ::std::tr1::is_abstract;
106  using ::std::tr1::has_trivial_constructor;
107  using ::std::tr1::has_trivial_copy;
108  using ::std::tr1::has_trivial_assign;
109  using ::std::tr1::has_trivial_destructor;
110  using ::std::tr1::has_nothrow_constructor;
111  using ::std::tr1::has_nothrow_copy;
112  using ::std::tr1::has_nothrow_assign;
113  using ::std::tr1::has_virtual_destructor;
114  using ::std::tr1::is_signed;
115  using ::std::tr1::is_unsigned;
116  using ::std::tr1::alignment_of;
117  using ::std::tr1::rank;
118  using ::std::tr1::extent;
119  using ::std::tr1::is_same;
120  using ::std::tr1::is_base_of;
121  using ::std::tr1::is_convertible;
122  using ::std::tr1::remove_const;
123  using ::std::tr1::remove_volatile;
124  using ::std::tr1::remove_cv;
125  using ::std::tr1::add_const;
126  using ::std::tr1::add_volatile;
127  using ::std::tr1::add_cv;
128  using ::std::tr1::remove_reference;
129  using ::std::tr1::add_reference;
130  using ::std::tr1::remove_extent;
131  using ::std::tr1::remove_all_extents;
132  using ::std::tr1::remove_pointer;
133  using ::std::tr1::add_pointer;
134  using ::std::tr1::aligned_storage;
135 } // namespace std
136 #endif
remove_const::type will be T
Definition: type_traits_bits.h:197
remove_volatile::type will be T
Definition: type_traits_bits.h:209
Definition: mpreal.h:3066
is_pointer::value will be true if T is a pointer type
Definition: type_traits_bits.h:69
is_reference::value will be true if T is a reference type
Definition: type_traits_bits.h:77
bool_constant< true > true_type
Definition: gtest-port.h:1618
is_fundamental::value will be true if T is a fundamental type
Definition: type_traits_bits.h:110
is_same returns true if A and B are the same type
Definition: type_traits_bits.h:162
bool_constant< false > false_type
Definition: gtest-port.h:1617
remove_reference<&T>::type will be T
Definition: type_traits_bits.h:243
is_const::value will be true if T is const
Definition: type_traits_bits.h:139
remove_pointer::type will be T
Definition: type_traits_bits.h:267
add_const::type will be const T
Definition: type_traits_bits.h:227
Definition: type_traits_bits.h:128
std::enable_if is similar to boost::enable_if_c for conditionally instantiating templates based on ty...
Definition: type_traits_bits.h:290
is_floating_point::value will be true if T is a fundamental floating-point type ...
Definition: type_traits_bits.h:36
true if T is void
Definition: type_traits_bits.h:21
remove_cv::type or remove_cv::type will be T
Definition: type_traits_bits.h:221
is_function::value is true if T is a function pointer
Definition: type_traits_bits.h:85
Definition: type_traits_bits.h:101
is_member_function_pointer::value is true if T is a member function pointer
Definition: type_traits_bits.h:91
is_array::value will be true if T is an array type
Definition: type_traits_bits.h:61
Definition: type_traits_bits.h:183
is_integral::value will be true if T is a fundamental integer type
Definition: type_traits_bits.h:29
Definition: type_traits_bits.h:116