00001 00002 #ifndef _INSTIGATE_OPEN_SOURCE_INTERNAL_HEADER_IN_CONCEPT 00003 #error This is an internal header file used to implement Instigate STL.\ 00004 It should never be included directly by a program. 00005 #endif 00006 00007 #ifndef INSTIGATE_STL_TYPE_TRAITS_H 00008 #define INSTIGATE_STL_TYPE_TRAITS_H 00009 00094 // Forward declaration 00095 namespace instigate { 00096 namespace stl { 00097 struct true_type; 00098 struct false_type; 00099 template <class _Tp> struct unary_type_traits; 00100 template <> struct unary_type_traits<bool>; 00101 template <> struct unary_type_traits<char>; 00102 template <> struct unary_type_traits<signed char>; 00103 template <> struct unary_type_traits<unsigned char>; 00104 template <> struct unary_type_traits<wchar_t>; 00105 template <> struct unary_type_traits<short>; 00106 template <> struct unary_type_traits<unsigned short>; 00107 template <> struct unary_type_traits<int>; 00108 template <> struct unary_type_traits<unsigned int>; 00109 template <> struct unary_type_traits<long>; 00110 template <> struct unary_type_traits<unsigned long>; 00111 template <> struct unary_type_traits<long long>; 00112 template <> struct unary_type_traits<unsigned long long>; 00113 template <> struct unary_type_traits<float>; 00114 template <> struct unary_type_traits<double>; 00115 template <> struct unary_type_traits<long double>; 00116 00117 template <class _Tp> struct unary_type_traits<_Tp*>; 00118 template <> struct unary_type_traits<char*>; 00119 template <> struct unary_type_traits<signed char*>; 00120 template <> struct unary_type_traits<unsigned char*>; 00121 template <> struct unary_type_traits<const char*>; 00122 template <> struct unary_type_traits<const signed char*>; 00123 template <> struct unary_type_traits<const unsigned char*>; 00124 } 00125 } 00126 00128 struct instigate::stl::true_type 00129 { 00130 }; 00131 00133 struct instigate::stl::false_type 00134 { 00135 }; 00136 00138 template <class _Tp> 00139 struct instigate::stl::unary_type_traits 00140 { 00147 typedef instigate::stl::true_type this_dummy_member_must_be_first; 00148 00149 /* The following restrictions should be observed for the sake of 00150 * compilers which automatically produce type specific specializations 00151 * of this class: 00152 * - You may reorder the members below if you wish 00153 * - You may remove any of the members below if you wish 00154 * - You must not rename members without making the corresponding 00155 * name change in the compiler 00156 * - Members you add will be treated like regular members unless 00157 * you add the appropriate support in the compiler. 00158 */ 00159 00161 typedef instigate::stl::false_type has_trivial_default_constructor; 00162 00164 typedef instigate::stl::false_type has_trivial_copy_constructor; 00165 00167 typedef instigate::stl::false_type has_trivial_assignment_operator; 00168 00170 typedef instigate::stl::false_type has_trivial_destructor; 00171 00173 typedef instigate::stl::false_type is_POD_type; 00174 }; 00175 00182 00183 template <> 00184 struct instigate::stl::unary_type_traits<bool> 00185 { 00187 typedef instigate::stl::true_type has_trivial_default_constructor; 00188 00190 typedef instigate::stl::true_type has_trivial_copy_constructor; 00191 00193 typedef instigate::stl::true_type has_trivial_assignment_operator; 00194 00196 typedef instigate::stl::true_type has_trivial_destructor; 00197 00199 typedef instigate::stl::true_type is_POD_type; 00200 }; 00201 00203 template <> 00204 struct instigate::stl::unary_type_traits<char> 00205 { 00207 typedef instigate::stl::true_type has_trivial_default_constructor; 00208 00210 typedef instigate::stl::true_type has_trivial_copy_constructor; 00211 00213 typedef instigate::stl::true_type has_trivial_assignment_operator; 00214 00216 typedef instigate::stl::true_type has_trivial_destructor; 00217 00219 typedef instigate::stl::true_type is_POD_type; 00220 }; 00221 00226 template <> 00227 struct instigate::stl::unary_type_traits<signed char> 00228 { 00230 typedef instigate::stl::true_type has_trivial_default_constructor; 00231 00233 typedef instigate::stl::true_type has_trivial_copy_constructor; 00234 00236 typedef instigate::stl::true_type has_trivial_assignment_operator; 00237 00239 typedef instigate::stl::true_type has_trivial_destructor; 00240 00242 typedef instigate::stl::true_type is_POD_type; 00243 }; 00244 00249 template <> 00250 struct instigate::stl::unary_type_traits<unsigned char> 00251 { 00253 typedef instigate::stl::true_type has_trivial_default_constructor; 00254 00256 typedef instigate::stl::true_type has_trivial_copy_constructor; 00257 00259 typedef instigate::stl::true_type has_trivial_assignment_operator; 00260 00262 typedef instigate::stl::true_type has_trivial_destructor; 00263 00265 typedef instigate::stl::true_type is_POD_type; 00266 }; 00267 00269 template <> 00270 struct instigate::stl::unary_type_traits<wchar_t> 00271 { 00273 typedef instigate::stl::true_type has_trivial_default_constructor; 00274 00276 typedef instigate::stl::true_type has_trivial_copy_constructor; 00277 00279 typedef instigate::stl::true_type has_trivial_assignment_operator; 00280 00282 typedef instigate::stl::true_type has_trivial_destructor; 00283 00285 typedef instigate::stl::true_type is_POD_type; 00286 }; 00287 00289 template <> 00290 struct instigate::stl::unary_type_traits<short> 00291 { 00293 typedef instigate::stl::true_type has_trivial_default_constructor; 00294 00296 typedef instigate::stl::true_type has_trivial_copy_constructor; 00297 00299 typedef instigate::stl::true_type has_trivial_assignment_operator; 00300 00302 typedef instigate::stl::true_type has_trivial_destructor; 00303 00305 typedef instigate::stl::true_type is_POD_type; 00306 }; 00307 00312 template <> 00313 struct instigate::stl::unary_type_traits<unsigned short> 00314 { 00316 typedef instigate::stl::true_type has_trivial_default_constructor; 00317 00319 typedef instigate::stl::true_type has_trivial_copy_constructor; 00320 00322 typedef instigate::stl::true_type has_trivial_assignment_operator; 00323 00325 typedef instigate::stl::true_type has_trivial_destructor; 00326 00328 typedef instigate::stl::true_type is_POD_type; 00329 }; 00330 00332 template <> 00333 struct instigate::stl::unary_type_traits<int> 00334 { 00336 typedef instigate::stl::true_type has_trivial_default_constructor; 00337 00339 typedef instigate::stl::true_type has_trivial_copy_constructor; 00340 00342 typedef instigate::stl::true_type has_trivial_assignment_operator; 00343 00345 typedef instigate::stl::true_type has_trivial_destructor; 00346 00348 typedef instigate::stl::true_type is_POD_type; 00349 }; 00350 00355 template <> 00356 struct instigate::stl::unary_type_traits<unsigned int> 00357 { 00359 typedef instigate::stl::true_type has_trivial_default_constructor; 00360 00362 typedef instigate::stl::true_type has_trivial_copy_constructor; 00363 00365 typedef instigate::stl::true_type has_trivial_assignment_operator; 00366 00368 typedef instigate::stl::true_type has_trivial_destructor; 00369 00371 typedef instigate::stl::true_type is_POD_type; 00372 }; 00373 00375 template <> 00376 struct instigate::stl::unary_type_traits<long> 00377 { 00379 typedef instigate::stl::true_type has_trivial_default_constructor; 00380 00382 typedef instigate::stl::true_type has_trivial_copy_constructor; 00383 00385 typedef instigate::stl::true_type has_trivial_assignment_operator; 00386 00388 typedef instigate::stl::true_type has_trivial_destructor; 00389 00391 typedef instigate::stl::true_type is_POD_type; 00392 }; 00393 00398 template <> 00399 struct instigate::stl::unary_type_traits<unsigned long> 00400 { 00402 typedef instigate::stl::true_type has_trivial_default_constructor; 00403 00405 typedef instigate::stl::true_type has_trivial_copy_constructor; 00406 00408 typedef instigate::stl::true_type has_trivial_assignment_operator; 00409 00411 typedef instigate::stl::true_type has_trivial_destructor; 00412 00414 typedef instigate::stl::true_type is_POD_type; 00415 }; 00416 00421 template <> 00422 struct instigate::stl::unary_type_traits<long long> 00423 { 00425 typedef instigate::stl::true_type has_trivial_default_constructor; 00426 00428 typedef instigate::stl::true_type has_trivial_copy_constructor; 00429 00431 typedef instigate::stl::true_type has_trivial_assignment_operator; 00432 00434 typedef instigate::stl::true_type has_trivial_destructor; 00435 00437 typedef instigate::stl::true_type is_POD_type; 00438 }; 00439 00444 template <> 00445 struct instigate::stl::unary_type_traits<unsigned long long> 00446 { 00448 typedef instigate::stl::true_type has_trivial_default_constructor; 00449 00451 typedef instigate::stl::true_type has_trivial_copy_constructor; 00452 00454 typedef instigate::stl::true_type has_trivial_assignment_operator; 00455 00457 typedef instigate::stl::true_type has_trivial_destructor; 00458 00460 typedef instigate::stl::true_type is_POD_type; 00461 }; 00462 00464 template <> 00465 struct instigate::stl::unary_type_traits<float> 00466 { 00468 typedef instigate::stl::true_type has_trivial_default_constructor; 00469 00471 typedef instigate::stl::true_type has_trivial_copy_constructor; 00472 00474 typedef instigate::stl::true_type has_trivial_assignment_operator; 00475 00477 typedef instigate::stl::true_type has_trivial_destructor; 00478 00480 typedef instigate::stl::true_type is_POD_type; 00481 }; 00482 00484 template <> 00485 struct instigate::stl::unary_type_traits<double> 00486 { 00488 typedef instigate::stl::true_type has_trivial_default_constructor; 00489 00491 typedef instigate::stl::true_type has_trivial_copy_constructor; 00492 00494 typedef instigate::stl::true_type has_trivial_assignment_operator; 00495 00497 typedef instigate::stl::true_type has_trivial_destructor; 00498 00500 typedef instigate::stl::true_type is_POD_type; 00501 }; 00502 00507 template <> 00508 struct instigate::stl::unary_type_traits<long double> 00509 { 00511 typedef instigate::stl::true_type has_trivial_default_constructor; 00512 00514 typedef instigate::stl::true_type has_trivial_copy_constructor; 00515 00517 typedef instigate::stl::true_type has_trivial_assignment_operator; 00518 00520 typedef instigate::stl::true_type has_trivial_destructor; 00521 00523 typedef instigate::stl::true_type is_POD_type; 00524 }; 00525 00526 00528 template <class _Tp> 00529 struct instigate::stl::unary_type_traits<_Tp*> 00530 { 00532 typedef instigate::stl::true_type has_trivial_default_constructor; 00533 00535 typedef instigate::stl::true_type has_trivial_copy_constructor; 00536 00538 typedef instigate::stl::true_type has_trivial_assignment_operator; 00539 00541 typedef instigate::stl::true_type has_trivial_destructor; 00542 00544 typedef instigate::stl::true_type is_POD_type; 00545 }; 00546 00551 template <> 00552 struct instigate::stl::unary_type_traits<char*> 00553 { 00555 typedef instigate::stl::true_type has_trivial_default_constructor; 00556 00558 typedef instigate::stl::true_type has_trivial_copy_constructor; 00559 00561 typedef instigate::stl::true_type has_trivial_assignment_operator; 00562 00564 typedef instigate::stl::true_type has_trivial_destructor; 00565 00567 typedef instigate::stl::true_type is_POD_type; 00568 }; 00569 00574 template <> 00575 struct instigate::stl::unary_type_traits<signed char*> 00576 { 00578 typedef instigate::stl::true_type has_trivial_default_constructor; 00579 00581 typedef instigate::stl::true_type has_trivial_copy_constructor; 00582 00584 typedef instigate::stl::true_type has_trivial_assignment_operator; 00585 00587 typedef instigate::stl::true_type has_trivial_destructor; 00588 00590 typedef instigate::stl::true_type is_POD_type; 00591 }; 00592 00597 template <> 00598 struct instigate::stl::unary_type_traits<unsigned char*> 00599 { 00601 typedef instigate::stl::true_type has_trivial_default_constructor; 00602 00604 typedef instigate::stl::true_type has_trivial_copy_constructor; 00605 00607 typedef instigate::stl::true_type has_trivial_assignment_operator; 00608 00610 typedef instigate::stl::true_type has_trivial_destructor; 00611 00613 typedef instigate::stl::true_type is_POD_type; 00614 }; 00615 00620 template <> 00621 struct instigate::stl::unary_type_traits<const char*> 00622 { 00624 typedef instigate::stl::true_type has_trivial_default_constructor; 00625 00627 typedef instigate::stl::true_type has_trivial_copy_constructor; 00628 00630 typedef instigate::stl::true_type has_trivial_assignment_operator; 00631 00633 typedef instigate::stl::true_type has_trivial_destructor; 00634 00636 typedef instigate::stl::true_type is_POD_type; 00637 }; 00638 00643 template <> 00644 struct instigate::stl::unary_type_traits<const signed char*> 00645 { 00647 typedef instigate::stl::true_type has_trivial_default_constructor; 00648 00650 typedef instigate::stl::true_type has_trivial_copy_constructor; 00651 00653 typedef instigate::stl::true_type has_trivial_assignment_operator; 00654 00656 typedef instigate::stl::true_type has_trivial_destructor; 00657 00659 typedef instigate::stl::true_type is_POD_type; 00660 }; 00661 00666 template <> 00667 struct instigate::stl::unary_type_traits<const unsigned char*> 00668 { 00670 typedef instigate::stl::true_type has_trivial_default_constructor; 00671 00673 typedef instigate::stl::true_type has_trivial_copy_constructor; 00674 00676 typedef instigate::stl::true_type has_trivial_assignment_operator; 00677 00679 typedef instigate::stl::true_type has_trivial_destructor; 00680 00682 typedef instigate::stl::true_type is_POD_type; 00683 }; 00684 00685 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq:textwidth=80: 00686 00687 #endif // INSTIGATE_STL_TYPE_TRAITS_HPP