// -*- C++ -*- /*************************************************************************** * * type_traits - definition of type_traits types * * $Id$ * *************************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License. * * Copyright 2008 Rogue Wave Software, Inc. * **************************************************************************/ #ifndef _RWSTD_TYPE_TRAITS_INCLUDED #define _RWSTD_TYPE_TRAITS_INCLUDED #include #ifdef _RWSTD_NO_EXT_CXX_0X # error _RWSTD_NO_EXT_CXX_0X defined and C++0x header included #endif #include #include #include #include #include #include #include #include #include #include #include _RWSTD_NAMESPACE (std) { template struct integral_constant { typedef integral_constant<_TypeT,_Value> type; typedef _TypeT value_type; static const _TypeT value = _Value; }; #ifndef _RWSTD_NO_STATIC_CONST_MEMBER_DEFINITION template const _TypeT integral_constant<_TypeT, _Value>::value; #endif // _RWSTD_NO_STATIC_CONST_MEMBER_DEFINITION typedef integral_constant true_type; typedef integral_constant false_type; template struct is_void : integral_constant::value> { }; template struct is_integral : integral_constant::value> { }; template struct is_floating_point : integral_constant::value> { }; template struct is_array : integral_constant::value> { }; template struct is_pointer : integral_constant::value> { }; template struct is_lvalue_reference : integral_constant::value> { }; template struct is_rvalue_reference : integral_constant::value> { }; template struct is_reference : integral_constant::value> { }; template struct is_member_object_pointer : integral_constant::value> { }; template struct is_member_function_pointer : integral_constant::value> { }; template struct is_enum : integral_constant::value> { }; template struct is_union : integral_constant::value > { }; template struct is_class : integral_constant::value> { }; template struct is_function : integral_constant::value> { }; template struct is_arithmetic : integral_constant::value> { }; template struct is_fundamental : integral_constant::value> { }; template struct is_object : integral_constant::value> { }; template struct is_scalar : integral_constant::value> { }; template struct is_compound : integral_constant::value> { }; template struct is_member_pointer : integral_constant::value> { }; template struct is_const : integral_constant::value> { }; template struct is_volatile : integral_constant::value> { }; template struct is_trivial : integral_constant::value> { }; template struct is_standard_layout : integral_constant::value> { }; template struct is_pod : integral_constant::value> { }; template struct is_empty : integral_constant::value> { }; template struct is_polymorphic : integral_constant::value> { }; template struct is_abstract : integral_constant::value> { }; template struct has_trivial_default_constructor : integral_constant::value> { }; template struct has_trivial_copy_constructor : integral_constant::value> { }; template struct has_trivial_assign : integral_constant::value> { }; template struct has_trivial_destructor : integral_constant::value> { }; template struct has_nothrow_default_constructor : integral_constant::value> { }; template struct has_nothrow_copy_constructor : integral_constant::value> { }; template struct has_nothrow_assign : integral_constant::value> { }; template struct has_virtual_destructor : integral_constant::value> { }; template struct is_signed : integral_constant::value> { }; template struct is_unsigned : integral_constant::value> { }; #ifndef _RWSTD_NO_ALIGN_TRAITS template struct alignment_of : integral_constant<_RWSTD_SIZE_T, _RW::__rw_alignment_of<_TypeT>::value> { }; #endif // _RWSTD_NO_ALIGN_TRAITS template struct rank : integral_constant<_RWSTD_SIZE_T, _RW::__rw_rank<_TypeT>::value> { }; template struct extent : integral_constant<_RWSTD_SIZE_T, _RW::__rw_extent<_TypeT, _Bound>::value> { }; template struct is_same : integral_constant::value> { }; template struct is_base_of : integral_constant::value> { }; template struct is_convertible : integral_constant::value> { }; template struct remove_const { typedef typename _RW::__rw_remove_const<_TypeT>::type type; }; template struct remove_volatile { typedef typename _RW::__rw_remove_volatile<_TypeT>::type type; }; template struct remove_cv { typedef typename _RW::__rw_remove_cv<_TypeT>::type type; }; template struct add_const { typedef typename _RW::__rw_add_const<_TypeT>::type type; }; template struct add_volatile { typedef typename _RW::__rw_add_volatile<_TypeT>::type type; }; template struct add_cv { typedef typename _RW::__rw_add_cv<_TypeT>::type type; }; template struct remove_reference { typedef typename _RW::__rw_remove_reference<_TypeT>::type type; }; template struct add_lvalue_reference { typedef typename _RW::__rw_add_lvalue_reference<_TypeT>::type type; }; template struct add_rvalue_reference { typedef typename _RW::__rw_add_rvalue_reference<_TypeT>::type type; }; template struct make_signed { typedef typename _RW::__rw_make_signed<_TypeT>::type type; }; template struct make_unsigned { typedef typename _RW::__rw_make_unsigned<_TypeT>::type type; }; template struct remove_extent { typedef typename _RW::__rw_remove_extent<_TypeT>::type type; }; template struct remove_all_extents { typedef typename _RW::__rw_remove_all_extents<_TypeT>::type type; }; template struct remove_pointer { typedef typename _RW::__rw_remove_pointer<_TypeT>::type type; }; template struct add_pointer { typedef typename _RW::__rw_add_pointer<_TypeT>::type type; }; #ifndef _RWSTD_NO_ALIGN_TRAITS template <_RWSTD_SIZE_T _Len, _RWSTD_SIZE_T _Align = _RW::__rw_default_alignment<_Len>::value> struct aligned_storage { typedef typename _RW::__rw_aligned_storage<_Len, _Align>::type type; }; # ifndef _RWSTD_NO_VARIADIC_TEMPLATES template <_RWSTD_SIZE_T _Len, class _TypeT, class... _Types> struct aligned_union : _RW::__rw_aligned_union<_Len, _TypeT, _Types...> { static const _RWSTD_SIZE_T alignment_value = _RW::__rw_aligned_union<_Len, _TypeT, _Types...>::_C_align_value; }; # else // !_RWSTD_NO_VARIADIC_TEMPLATES template <_RWSTD_SIZE_T _Len, class _Type1 , class _Type2 = _RW::__rw_empty, class _Type3 = _RW::__rw_empty, class _Type4 = _RW::__rw_empty, class _Type5 = _RW::__rw_empty, class _Type6 = _RW::__rw_empty, class _Type7 = _RW::__rw_empty, class _Type8 = _RW::__rw_empty> struct aligned_union : _RW::__rw_aligned_union<_Len, _Type1, _Type2, _Type3, _Type4, _Type5, _Type6, _Type7, _Type8> { static const _RWSTD_SIZE_T alignment_value = _RW::__rw_aligned_union<_Len, _Type1, _Type2, _Type3, _Type4, _Type5, _Type6, _Type7, _Type8>::_C_align_value; }; # endif // !_RWSTD_NO_VARIADIC_TEMPLATES #endif // !_RWSTD_NO_ALIGN_TRAITS template struct decay { typedef typename _RW::__rw_decay<_TypeT>::type type; }; template struct enable_if { typedef _TypeT type; }; template struct enable_if { }; template struct conditional { typedef typename _RW::__rw_conditional<_Select, _TypeT, _TypeU>::type type; }; } // namespace std #endif // _RWSTD_TYPE_TRAITS_INCLUDED