type_traits 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. // -*- C++ -*- Time-stamp: <08/07/20 19:10:15 ptr>
  2. /*
  3. * Copyright (c) 2007, 2008
  4. * Petr Ovtchenkov
  5. *
  6. * Licensed under the Academic Free License version 3.0
  7. *
  8. * Derived from original <misc/type_traits.h> of 'complement' project
  9. * [http://complement.sourceforge.net]
  10. * to make it close to JTC1/SC22/WG21 C++ 0x working draft
  11. * [http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2008/n2521.pdf]
  12. */
  13. #ifndef __STLP_TYPE_TRAITS
  14. #define __STLP_TYPE_TRAITS
  15. #ifndef _STLP_OUTERMOST_HEADER_ID
  16. # define _STLP_OUTERMOST_HEADER_ID 0x3
  17. # include <stl/_prolog.h>
  18. #endif
  19. // libstdc++ v3, timestamp 20050519 (3.4.4) has __type_traits,
  20. // libstdc++ v3, timestamp 20060306 (3.4.6) has __type_traits,
  21. // while libstdc++ v3, 20050921 (4.0.2) not; use libstdc++ instead
  22. // # if defined(STLPORT) || (defined(__GNUC__) && (__GNUC__ < 4)) /* !defined(__GLIBCXX__) || (defined(__GNUC__) && (__GNUC__ < 4)) */
  23. _STLP_BEGIN_NAMESPACE
  24. _STLP_BEGIN_TR1_NAMESPACE
  25. namespace detail {
  26. struct __select_types
  27. {
  28. typedef char __t1;
  29. struct __t2
  30. {
  31. char __two[2];
  32. };
  33. };
  34. template <class _Tp>
  35. struct __instance :
  36. public __select_types
  37. {
  38. private:
  39. template <class _Up>
  40. static __t1 __test(_Up(*)[1]);
  41. template <class>
  42. static __t2 __test(...);
  43. public:
  44. #ifdef _STLP_STATIC_CONST_INIT_BUG
  45. static const bool __value;
  46. #else
  47. static const bool __value = sizeof(__test<_Tp>(0)) == sizeof(__select_types::__t1);
  48. #endif
  49. };
  50. #ifdef _STLP_STATIC_CONST_INIT_BUG
  51. template <class _Tp>
  52. const bool __instance<_Tp>::__value = sizeof(__instance<_Tp>::__test<_Tp>(0)) == sizeof(__select_types::__t1);
  53. #endif
  54. template <class T>
  55. struct __uoc_aux : // union or class
  56. public __select_types
  57. {
  58. private:
  59. template <class _Up>
  60. static __t1 __test( int _Up::* );
  61. template <class>
  62. static __t2 __test(...);
  63. public:
  64. #ifdef __FIT_NO_INLINE_TEMPLATE_STATIC_INITIALISATION
  65. static const bool __value;
  66. #else
  67. static const bool __value = sizeof(__test<T>(0)) == sizeof(__select_types::__t1);
  68. #endif
  69. };
  70. #ifdef __FIT_NO_INLINE_TEMPLATE_STATIC_INITIALISATION
  71. template <class T>
  72. const bool __uoc_aux<T>::__value = sizeof(__uoc_aux<T>::__test<T>(0)) == sizeof(__select_types::__t1);
  73. #endif
  74. template <class T>
  75. class __empty
  76. { };
  77. template <class T, bool B>
  78. class __inheritance_aux
  79. {};
  80. template <class T>
  81. class __inheritance_aux<T,true> :
  82. public T
  83. {
  84. public:
  85. virtual ~__inheritance_aux()
  86. { }
  87. };
  88. #if 0
  89. template <class T, bool B>
  90. struct __virtual_aux
  91. {
  92. public:
  93. #ifdef _STLP_STATIC_CONST_INIT_BUG
  94. static const bool __value;
  95. #else
  96. static const bool __value = B ? (sizeof(__inheritance_aux<T,B>) == sizeof(T)) : false;
  97. #endif
  98. };
  99. #ifdef _STLP_STATIC_CONST_INIT_BUG
  100. template <class T, bool B>
  101. const bool __virtual_aux<T,B>::__value = B ? (sizeof(__inheritance_aux<T,B>) == sizeof(T)) : false;
  102. #endif
  103. #endif
  104. } // namespace detail
  105. template <class _Tp, _Tp __v>
  106. struct integral_constant
  107. {
  108. static const _Tp value = __v;
  109. // enum { value = __v }; ?
  110. typedef _Tp value_type;
  111. typedef integral_constant<_Tp, __v> type;
  112. };
  113. typedef integral_constant<bool, true> true_type;
  114. typedef integral_constant<bool, false> false_type;
  115. namespace detail {
  116. template <typename _Tp>
  117. struct __is_union_or_class :
  118. public integral_constant<bool, __uoc_aux<_Tp>::__value>
  119. { };
  120. #if 0
  121. template<typename _Tp>
  122. struct __is_vtbl : // has virtual table?
  123. public integral_constant<bool, __virtual_aux<_Tp,__is_union_or_class<_Tp>::value >::__value>
  124. { };
  125. #endif
  126. template <typename _Tp>
  127. struct __is_vtbl : // has virtual table?
  128. public integral_constant<bool, __is_union_or_class<_Tp>::value ? (sizeof(__inheritance_aux<_Tp,__is_union_or_class<_Tp>::value>) == sizeof(_Tp)) : false >
  129. { };
  130. } // namespace detail
  131. #define __SPEC_(C,T,B) \
  132. template <> \
  133. struct C<T> : \
  134. public integral_constant<bool, B> \
  135. { }
  136. #define __CV_SPEC(C,T,B) \
  137. __SPEC_(C,T,B); \
  138. __SPEC_(C,const T,B); \
  139. __SPEC_(C,volatile T,B); \
  140. __SPEC_(C,const volatile T,B)
  141. #define __SPEC_1(C,T,B) \
  142. template <class _Tp> \
  143. struct C<T> : \
  144. public integral_constant<bool, B> \
  145. { }
  146. #define __CV_SPEC_1(C,T,B) \
  147. __SPEC_1(C,T,B); \
  148. __SPEC_1(C,T const,B); \
  149. __SPEC_1(C,T volatile,B); \
  150. __SPEC_1(C,T const volatile,B)
  151. #define __SPEC_2(C,T,B) \
  152. template <class _Tp1, class _Tp2> \
  153. struct C<T> : \
  154. public integral_constant<bool, B> \
  155. { }
  156. #define __CV_SPEC_2(C,T,B) \
  157. __SPEC_2(C,T,B); \
  158. __SPEC_2(C,T const,B); \
  159. __SPEC_2(C,T volatile,B); \
  160. __SPEC_2(C,T const volatile,B)
  161. // [4.5.1] primary type categories:
  162. template <class _Tp>
  163. struct is_void :
  164. public false_type
  165. { };
  166. template <>
  167. struct is_void<void> :
  168. public true_type
  169. { };
  170. template <class _Tp>
  171. struct is_integral :
  172. public false_type
  173. { };
  174. __CV_SPEC(is_integral,bool,true);
  175. __CV_SPEC(is_integral,char,true);
  176. __CV_SPEC(is_integral,signed char,true);
  177. __CV_SPEC(is_integral,unsigned char,true);
  178. __CV_SPEC(is_integral,wchar_t,true);
  179. __CV_SPEC(is_integral,short,true);
  180. __CV_SPEC(is_integral,unsigned short,true);
  181. __CV_SPEC(is_integral,int,true);
  182. __CV_SPEC(is_integral,unsigned int,true);
  183. __CV_SPEC(is_integral,long,true);
  184. __CV_SPEC(is_integral,unsigned long,true);
  185. __CV_SPEC(is_integral,long long,true);
  186. __CV_SPEC(is_integral,unsigned long long,true);
  187. template <class _Tp>
  188. struct is_floating_point :
  189. public false_type
  190. { };
  191. __CV_SPEC(is_floating_point,float,true);
  192. __CV_SPEC(is_floating_point,double,true);
  193. __CV_SPEC(is_floating_point,long double,true);
  194. template <class _Tp>
  195. struct is_array :
  196. public false_type
  197. { };
  198. template <class _Tp, _STLP_STD::size_t _Sz>
  199. struct is_array<_Tp[_Sz]> :
  200. public true_type
  201. { };
  202. template <class _Tp>
  203. struct is_array<_Tp[]> :
  204. public true_type
  205. { };
  206. template <class _Tp>
  207. struct is_pointer :
  208. public false_type
  209. { };
  210. __CV_SPEC_1(is_pointer,_Tp *,true);
  211. template <class _Tp>
  212. struct is_lvalue_reference :
  213. public false_type
  214. { };
  215. template <class _Tp>
  216. struct is_lvalue_reference<_Tp&> :
  217. public true_type
  218. { };
  219. template <class _Tp>
  220. struct is_rvalue_reference :
  221. public false_type
  222. { };
  223. // template <class _Tp>
  224. // struct is_rvalue_reference<_Tp&&> :
  225. // public true_type
  226. // { };
  227. template <class _Tp>
  228. struct is_reference :
  229. public false_type
  230. { };
  231. template <class _Tp>
  232. struct is_reference<_Tp&> :
  233. public true_type
  234. { };
  235. template <class _Tp>
  236. struct is_function :
  237. public integral_constant<bool, !(detail::__instance<_Tp>::__value
  238. || detail::__is_union_or_class<_Tp>::value
  239. || is_reference<_Tp>::value
  240. || is_void<_Tp>::value)>
  241. { };
  242. template <class _Tp>
  243. struct is_member_object_pointer :
  244. public false_type
  245. { };
  246. // _SPEC_FULL2(is_member_object_pointer, _Tp1 _Tp2::*,!is_function<_Tp1>::value);
  247. template <class _Tp1, class _Tp2>
  248. struct is_member_object_pointer<_Tp1 _Tp2::*> :
  249. public integral_constant<bool, !is_function<_Tp1>::value>
  250. { };
  251. template <class _Tp1, class _Tp2>
  252. struct is_member_object_pointer<_Tp1 _Tp2::* const> :
  253. public integral_constant<bool, !is_function<_Tp1>::value>
  254. { };
  255. template <class _Tp1, class _Tp2>
  256. struct is_member_object_pointer<_Tp1 _Tp2::* volatile> :
  257. public integral_constant<bool, !is_function<_Tp1>::value>
  258. { };
  259. template <class _Tp1, class _Tp2>
  260. struct is_member_object_pointer<_Tp1 _Tp2::* const volatile> :
  261. public integral_constant<bool, !is_function<_Tp1>::value>
  262. { };
  263. template <class _Tp>
  264. struct is_member_function_pointer :
  265. public false_type
  266. { };
  267. // _SPEC_FULL2(is_member_function_pointer,_Tp1 _Tp2::*,is_function<_Tp1>::value);
  268. template <class _Tp1, class _Tp2>
  269. struct is_member_function_pointer<_Tp1 _Tp2::*> :
  270. public integral_constant<bool, is_function<_Tp1>::value>
  271. { };
  272. template <class _Tp1, class _Tp2>
  273. struct is_member_function_pointer<_Tp1 _Tp2::* const> :
  274. public integral_constant<bool, is_function<_Tp1>::value>
  275. { };
  276. template <class _Tp1, class _Tp2>
  277. struct is_member_function_pointer<_Tp1 _Tp2::* volatile> :
  278. public integral_constant<bool, is_function<_Tp1>::value>
  279. { };
  280. template <class _Tp1, class _Tp2>
  281. struct is_member_function_pointer<_Tp1 _Tp2::* const volatile> :
  282. public integral_constant<bool, is_function<_Tp1>::value>
  283. { };
  284. template <class _Tp>
  285. struct is_member_pointer :
  286. public integral_constant<bool, (is_member_object_pointer<_Tp>::value || is_member_function_pointer<_Tp>::value)>
  287. { };
  288. // 4.5.2 composite type categories
  289. template <class _Tp>
  290. struct is_arithmetic :
  291. public integral_constant<bool, (is_integral<_Tp>::value || is_floating_point<_Tp>::value)>
  292. { };
  293. template <class _Tp>
  294. struct is_fundamental :
  295. public integral_constant<bool, (is_arithmetic<_Tp>::value || is_void<_Tp>::value)>
  296. { };
  297. // [4.5.1] primary type categories (continued):
  298. template <class _Tp>
  299. struct is_enum :
  300. public integral_constant<bool, !(is_fundamental<_Tp>::value
  301. || is_array<_Tp>::value
  302. || is_pointer<_Tp>::value
  303. || is_reference<_Tp>::value
  304. || is_member_pointer<_Tp>::value
  305. || is_function<_Tp>::value
  306. || detail::__is_union_or_class<_Tp>::value) >
  307. { };
  308. template <class T>
  309. struct is_union
  310. { };
  311. template <class T>
  312. struct is_class
  313. { };
  314. // is_function (above)
  315. // 4.5.2 composite type categories (continued)
  316. // is_arithmetic (above)
  317. // is_fundamental (above)
  318. template <class _Tp>
  319. struct is_object :
  320. public integral_constant<bool, (is_arithmetic<_Tp>::value ||
  321. is_array<_Tp>::value ||
  322. is_pointer<_Tp>::value ||
  323. is_member_pointer<_Tp>::value ||
  324. detail::__is_union_or_class<_Tp>::value)>
  325. { };
  326. template <class _Tp>
  327. struct is_scalar :
  328. public integral_constant<bool, (is_arithmetic<_Tp>::value
  329. || is_enum<_Tp>::value
  330. || is_pointer<_Tp>::value
  331. || is_member_pointer<_Tp>::value)>
  332. { };
  333. template <class _Tp>
  334. struct is_compound :
  335. public integral_constant<bool, !is_fundamental<_Tp>::value>
  336. { };
  337. // is_member_pointer
  338. // 4.5.3 type properties:
  339. template <class _Tp>
  340. struct is_const :
  341. public false_type
  342. { };
  343. template <class _Tp>
  344. struct is_const<_Tp const> :
  345. public true_type
  346. { };
  347. template <class _Tp>
  348. struct is_volatile :
  349. public false_type
  350. { };
  351. template <class _Tp>
  352. struct is_volatile<_Tp volatile> :
  353. public true_type
  354. { };
  355. // 4.7.3 array modifications:
  356. template <class _Tp>
  357. struct remove_extent
  358. {
  359. typedef _Tp type;
  360. };
  361. template <class _Tp, _STLP_STD::size_t _Sz>
  362. struct remove_extent<_Tp[_Sz]>
  363. {
  364. typedef _Tp type;
  365. };
  366. template <class _Tp>
  367. struct remove_extent<_Tp[]>
  368. {
  369. typedef _Tp type;
  370. };
  371. template <class _Tp>
  372. struct remove_all_extents
  373. {
  374. typedef _Tp type;
  375. };
  376. template <class _Tp, _STLP_STD::size_t _Size>
  377. struct remove_all_extents<_Tp[_Size]>
  378. {
  379. typedef typename remove_all_extents<_Tp>::type type;
  380. };
  381. template<typename _Tp>
  382. struct remove_all_extents<_Tp[]>
  383. {
  384. typedef typename remove_all_extents<_Tp>::type type;
  385. };
  386. // 4.5.3 type properties (continued):
  387. template <class _Tp>
  388. struct is_trivial :
  389. public integral_constant<bool, (is_void<_Tp>::value
  390. || is_scalar<typename remove_all_extents<_Tp>::type>::value)>
  391. { };
  392. template <class _Tp>
  393. struct is_standard_layout :
  394. public integral_constant<bool, (is_void<_Tp>::value
  395. || is_scalar<typename remove_all_extents<_Tp>::type>::value)>
  396. { };
  397. template <class _Tp>
  398. struct is_pod :
  399. public integral_constant<bool, (is_void<_Tp>::value
  400. || is_scalar<typename remove_all_extents<_Tp>::type>::value)>
  401. { };
  402. template<typename _Tp>
  403. struct is_empty
  404. : public integral_constant<bool, (detail::__is_union_or_class<_Tp>::value
  405. && (sizeof(detail::__empty<_Tp>) == sizeof(_Tp)))>
  406. { };
  407. // is_polimorphic
  408. // is_abstract
  409. template <class _Tp>
  410. struct has_trivial_constructor :
  411. public integral_constant<bool, is_pod<_Tp>::value>
  412. { };
  413. template <class _Tp>
  414. struct has_trivial_copy :
  415. public integral_constant<bool, is_pod<_Tp>::value>
  416. { };
  417. template <class _Tp>
  418. struct has_trivial_assign :
  419. public integral_constant<bool, is_pod<_Tp>::value>
  420. { };
  421. template <class _Tp>
  422. struct has_trivial_destructor :
  423. public integral_constant<bool, is_pod<_Tp>::value>
  424. { };
  425. template <class _Tp>
  426. struct has_nothrow_constructor :
  427. public integral_constant<bool, is_pod<_Tp>::value>
  428. { };
  429. template <class _Tp>
  430. struct has_nothrow_copy :
  431. public integral_constant<bool, is_pod<_Tp>::value>
  432. { };
  433. template <class _Tp>
  434. struct has_nothrow_assign :
  435. public integral_constant<bool, is_pod<_Tp>::value>
  436. { };
  437. template <class _Tp>
  438. struct has_virtual_destructor :
  439. public false_type
  440. { };
  441. template <class _Tp>
  442. struct is_signed :
  443. public false_type
  444. { };
  445. __CV_SPEC(is_signed,signed char,true);
  446. __CV_SPEC(is_signed,short,true);
  447. __CV_SPEC(is_signed,int,true);
  448. __CV_SPEC(is_signed,long,true);
  449. __CV_SPEC(is_signed,long long,true);
  450. template <class _Tp>
  451. struct is_unsigned :
  452. public false_type
  453. { };
  454. __CV_SPEC(is_unsigned,unsigned char,true);
  455. __CV_SPEC(is_unsigned,unsigned short,true);
  456. __CV_SPEC(is_unsigned,unsigned int,true);
  457. __CV_SPEC(is_unsigned,unsigned long,true);
  458. __CV_SPEC(is_unsigned,unsigned long long,true);
  459. // alignment_of
  460. // rank
  461. // extent
  462. // 4.6 type relations:
  463. template <class _Tp1, class _Tp2>
  464. struct is_same :
  465. public false_type
  466. { };
  467. template <class _Tp>
  468. struct is_same<_Tp, _Tp> :
  469. public true_type
  470. { };
  471. // is_base_of
  472. // is_convertible
  473. // 4.7.1 const-volatile modifications
  474. template <class _Tp>
  475. struct remove_const
  476. {
  477. typedef _Tp type;
  478. };
  479. template <class _Tp>
  480. struct remove_const<_Tp const>
  481. {
  482. typedef _Tp type;
  483. };
  484. template <class _Tp>
  485. struct remove_volatile
  486. {
  487. typedef _Tp type;
  488. };
  489. template <class _Tp>
  490. struct remove_volatile<_Tp volatile>
  491. {
  492. typedef _Tp type;
  493. };
  494. template <class _Tp>
  495. struct remove_cv
  496. {
  497. typedef typename remove_const<typename remove_volatile<_Tp>::type>::type type;
  498. };
  499. template <class _Tp>
  500. struct add_const
  501. {
  502. typedef _Tp const type;
  503. };
  504. template <class _Tp>
  505. struct add_volatile
  506. {
  507. typedef _Tp volatile type;
  508. };
  509. template <class _Tp>
  510. struct add_cv
  511. {
  512. typedef typename add_const<typename add_volatile<_Tp>::type>::type type;
  513. };
  514. // 4.7.2 reference modifications:
  515. template <class _Tp>
  516. struct remove_reference
  517. {
  518. typedef _Tp type;
  519. };
  520. template <class _Tp>
  521. struct remove_reference<_Tp&>
  522. {
  523. typedef _Tp type;
  524. };
  525. template <class _Tp>
  526. struct add_reference
  527. {
  528. typedef _Tp& type;
  529. };
  530. template <class _Tp>
  531. struct add_reference<_Tp&>
  532. {
  533. typedef _Tp& type;
  534. };
  535. // 4.7.3 array modifications (see above)
  536. // 4.7.4 pointer modifications:
  537. template <class _Tp>
  538. struct remove_pointer
  539. {
  540. typedef _Tp type;
  541. };
  542. template <class _Tp>
  543. struct remove_pointer<_Tp *>
  544. {
  545. typedef _Tp type;
  546. };
  547. template <class _Tp>
  548. struct remove_pointer<_Tp * const>
  549. {
  550. typedef _Tp type;
  551. };
  552. template <class _Tp>
  553. struct remove_pointer<_Tp * volatile>
  554. {
  555. typedef _Tp type;
  556. };
  557. template <class _Tp>
  558. struct remove_pointer<_Tp * const volatile>
  559. {
  560. typedef _Tp type;
  561. };
  562. template <class _Tp>
  563. struct add_pointer
  564. {
  565. typedef typename remove_reference<_Tp>::type * type;
  566. };
  567. // 20.5.7 other transformations:
  568. // template <_STLP_STD::size_t Len, _STLP_STD::size_t Align> struct aligned_storage;
  569. // template <_STLP_STD::size_t Len, class... Types> struct aligned_union;
  570. namespace detail {
  571. template <bool,class _U>
  572. struct _decay_aux2
  573. {
  574. typedef typename remove_cv<_U>::type type;
  575. };
  576. template <class _U>
  577. struct _decay_aux2<true,_U>
  578. {
  579. typedef typename add_pointer<_U>::type type;
  580. };
  581. template <bool, class _U>
  582. struct _decay_aux1
  583. {
  584. typedef typename _decay_aux2<is_function<_U>::value,_U>::type type;
  585. };
  586. template <class _U>
  587. struct _decay_aux1<true,_U>
  588. {
  589. typedef typename remove_extent<_U>::type* type;
  590. };
  591. } // namespace detail
  592. template <class _Tp>
  593. class decay
  594. {
  595. private:
  596. typedef typename remove_reference<_Tp>::type _U;
  597. public:
  598. typedef typename detail::_decay_aux1<is_array<_U>::value,_U>::type type;
  599. };
  600. template <bool, class _Tp = void>
  601. struct enable_if
  602. {
  603. };
  604. template <class _Tp>
  605. struct enable_if<true,_Tp>
  606. {
  607. typedef _Tp type;
  608. };
  609. template <bool, class _Tp1, class _Tp2>
  610. struct conditional
  611. {
  612. typedef _Tp2 type;
  613. };
  614. template <class _Tp1, class _Tp2>
  615. struct conditional<true,_Tp1,_Tp2>
  616. {
  617. typedef _Tp1 type;
  618. };
  619. // template <class... _Tp> struct common_type;
  620. #undef __CV_SPEC
  621. #undef __SPEC_
  622. #undef __CV_SPEC_1
  623. #undef __SPEC_1
  624. #undef __CV_SPEC_2
  625. #undef __SPEC_2
  626. _STLP_END_NAMESPACE // tr1
  627. _STLP_END_NAMESPACE
  628. // # else // __GLIBCXX__ && (__GNUC__ >= 4) && !STLPORT
  629. // # include <tr1/type_traits>
  630. // # endif
  631. #if (_STLP_OUTERMOST_HEADER_ID == 0x3)
  632. # include <stl/_epilog.h>
  633. # undef _STLP_OUTERMOST_HEADER_ID
  634. #endif
  635. #endif // __STLP_TYPE_TRAITS