From a60348ca813aca4e6098ea6b074b6979e1f2f4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Wed, 17 Sep 2014 09:00:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinySTL/TinySTL.vcxproj | 3 + TinySTL/TinySTL.vcxproj.filters | 5 + TinySTL/TypeTraits.h | 463 ++++++++++++++++---------------- 3 files changed, 239 insertions(+), 232 deletions(-) diff --git a/TinySTL/TinySTL.vcxproj b/TinySTL/TinySTL.vcxproj index 0a45209..d5e4188 100644 --- a/TinySTL/TinySTL.vcxproj +++ b/TinySTL/TinySTL.vcxproj @@ -78,6 +78,9 @@ + + + diff --git a/TinySTL/TinySTL.vcxproj.filters b/TinySTL/TinySTL.vcxproj.filters index 333f5a9..cf09af5 100644 --- a/TinySTL/TinySTL.vcxproj.filters +++ b/TinySTL/TinySTL.vcxproj.filters @@ -19,4 +19,9 @@ 源文件 + + + 头文件 + + \ No newline at end of file diff --git a/TinySTL/TypeTraits.h b/TinySTL/TypeTraits.h index 342f59a..701ab79 100644 --- a/TinySTL/TypeTraits.h +++ b/TinySTL/TypeTraits.h @@ -2,241 +2,240 @@ #define _TYPE_TRAITS_H_ namespace TinySTL{ - namespace zstd + + struct _true_type { }; + struct _false_type { }; + + /* + ** ȡT͵ + */ + template + struct _type_traits { - struct _true_type { }; - struct _false_type { }; + typedef _false_type has_trivial_default_constructor; + typedef _false_type has_trivial_copy_constructor; + typedef _false_type has_trivial_assignment_operator; + typedef _false_type has_trivial_destructor; + typedef _false_type is_POD_type; + }; - /* - ** ȡT͵ - */ - template - struct _type_traits - { - typedef _false_type has_trivial_default_constructor; - typedef _false_type has_trivial_copy_constructor; - typedef _false_type has_trivial_assignment_operator; - typedef _false_type has_trivial_destructor; - typedef _false_type is_POD_type; - }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - - template - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; - template<> - struct _type_traits - { - typedef _true_type has_trivial_default_constructor; - typedef _true_type has_trivial_copy_constructor; - typedef _true_type has_trivial_assignment_operator; - typedef _true_type has_trivial_destructor; - typedef _true_type is_POD_type; - }; + template + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; + template<> + struct _type_traits + { + typedef _true_type has_trivial_default_constructor; + typedef _true_type has_trivial_copy_constructor; + typedef _true_type has_trivial_assignment_operator; + typedef _true_type has_trivial_destructor; + typedef _true_type is_POD_type; + }; } #endif \ No newline at end of file