diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-07-29 12:43:11 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-08-09 15:35:56 +0200 |
commit | 65ade55c8cf89db0bb6efbda7e9a2f9443398f5d (patch) | |
tree | c6a456072f0db292666458d33bcf87ec511183db | |
parent | d1ede822d8b76748a4f24e5a03fc12847b1119ba (diff) |
Add QtPrivate::is_const and is_volatile
And correct the comment by listing more types that are available
Change-Id: I9cb4b664f97300357a55d81bc99dd542a29e933b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r-- | src/corelib/global/qtypetraits.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h index 2ae66da92b..80867b284b 100644 --- a/src/corelib/global/qtypetraits.h +++ b/src/corelib/global/qtypetraits.h @@ -82,11 +82,15 @@ // is_pointer // is_enum // is_reference +// is_const +// is_volatile // is_pod // has_trivial_constructor // has_trivial_copy // has_trivial_assign // has_trivial_destructor +// is_signed +// is_unsigned // remove_const // remove_volatile // remove_cv @@ -325,6 +329,11 @@ template <class T> struct is_enum<const volatile T> : is_enum<T> { }; template<typename T> struct is_reference : false_type {}; template<typename T> struct is_reference<T&> : true_type {}; +// Specified by TR1 [4.5.3] Type Properties +template <typename T> struct is_const : false_type {}; +template <typename T> struct is_const<const T> : true_type {}; +template <typename T> struct is_volatile : false_type {}; +template <typename T> struct is_volatile<volatile T> : true_type {}; // We can't get is_pod right without compiler help, so fail conservatively. // We will assume it's false except for arithmetic types, enumerations, |