Changeset 49572 in vbox
- Timestamp:
- Nov 20, 2013 9:59:42 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/array.h
r47848 r49572 4 4 5 5 /* 6 * Copyright (C) 2006-201 2Oracle Corporation6 * Copyright (C) 2006-2013 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 164 164 #endif 165 165 166 /* Type traits are a C++ 11 feature, so not available everywhere (yet). */ 167 /* Only GCC 4.6 or newer. */ 168 #if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406) \ 169 /* Only MSVC++ 10.0 (Visual Studio 2010) or newer. */ \ 170 || (defined(_MSC_VER) && (_MSC_VER >= 1600)) 171 #define VBOX_WITH_TYPE_TRAITS 172 #endif 173 174 #ifdef VBOX_WITH_TYPE_TRAITS 175 # include <type_traits> 176 #endif 177 166 178 #include "VBox/com/defs.h" 167 179 #include "VBox/com/ptr.h" … … 394 406 static VARTYPE VarType() 395 407 { 408 #ifdef VBOX_WITH_TYPE_TRAITS 409 if ( std::is_integral<T>::value 410 && !std::is_signed<T>::value) 411 { 412 if (sizeof(T) % 8 == 0) return VT_UI8; 413 if (sizeof(T) % 4 == 0) return VT_UI4; 414 if (sizeof(T) % 2 == 0) return VT_UI2; 415 return VT_UI1; 416 } 417 #endif 396 418 if (sizeof(T) % 8 == 0) return VT_I8; 397 419 if (sizeof(T) % 4 == 0) return VT_I4;
Note:
See TracChangeset
for help on using the changeset viewer.