特徴技術の抽出C ++標準ライブラリ(VII)のSTL(G)

特徴技術のC ++標準ライブラリ(VII)

特徴技術

原理:テンプレート引数控除メカニズムの使用はタイプで渡されたパラメータを取得します。

template<typename T>
struct Iter { typedef T value_type; .... } template<typename T> typename T::value_type func(T* ite) {return *ite;}

この度は、まだ問題が発生した:それは(例えばポインタ、参照など)クラス型でない場合は、正しいパラメータを導出することはできません。あなたはこのような状況を処理するために、テンプレートの部分特殊化を使用することができます。

template<typename T>
struct Iter<T*> { typename T value_type; };

私たちは、コア問題に対処する必要があります。技術的な特性で説明したイテレータ型が行う取得する方法?

template<typename T>
struct iterator_traits { typedef typename T::iterator_category iterator_category; typedef typename T::value_type value_type; typedef typename T::difference_type difference_type; typedef typename T::pointer pointer; typedef typename T::reference reference; };

同時に、にiterator_traitsは、着信ポインタとポインタツーconstの専門分野を設計するために入力する必要があります。

template<typename T>
struct iterator_traits<T*> { ... typedef random_access_iterator_tag iterator_category; } template<typename T> struct iterator_traits<const T*> { ... typedef random_access_iretator_tag iterator_category; }

入力しないでください。

  • タイプ値:オブジェクト・タイプを指して説明イテレータ。
  • 型-difference 2つの説明イテレータの間の距離、組み込みC ++型ptrdiff_tのデフォルトを使用して
  • Reference型のオブジェクトへの参照説明イテレータ:
  • 型ポインタ:オブジェクト・イテレータへのポインタの説明
  • iterator_category:説明それぞれの性別のイテレータ
    • INPUTをイテレータ:読み取り専用反復子
    • 出力をイテレータ:書き込み専用反復子
    • イテレータフォワード:読み書きイテレータ
    • イテレータ双方向:双方向移動イテレータ、読み書きできます
    • イテレータにランダムアクセスイテレータランダムな動きを読み、書くことができます。

コンパイル時の貫通イテレータの異なるバージョンの機能の異なるバージョンの選択に、オーバーロードを使用:

template<typename category,typename T,typename dis=ptrdiff_t,typename poin=T*,typename ref=T&> struct iterator { typedef category iterator_category; typedef T value_type; typedef dis difference_type; typedef poin pointer; typedef ref reference; }; struct input_iterator_tag {}; struct output_iterator_tag {}; struct forward_iterator_tag : public input_iterator_tag {}; struct bidirectional_iterator_tag : public forward_iterator_tag {}; struct random_access_iterator_tag : public bidirectional_iterator_tag {}; template <typename InputIterator,typename Distance> inline void __advance(InputIterator& iter,Distance n,input_iterator_tag) { while(n--) ++iter; } template <typename ForwardIterator,typename Distance> inline void __advance(ForwardIterator& iter,Distance n,forward_iterator_tag) { __advance(i,n,input_iterator_tag()); } template <typename BidirectionalIterator,typename Distance> inline void __advance(BidirectionalIterator& iter,Distance n,bidirectional_iterator_tag) { if(n > 0) while(n--) ++iter; if(n < 0) while(n--) --iter; } template <typename RandomAccessIterator,typename Distance> inline void __advance(RandomAccessIterator& iter,Distance n,random_access_iterator_tag) { iter += n; }

特性のメカニズムをよると、次のラッパーを使用する必要があります。

template <typename InputIterator,typename Distance>
inline void __advance(InputIterator& iter,Distance n) { __advance(i,n,iteratir_traits<InputIterator>::iterator_category()); }

その他の機能をソーシング:

template<typename Iterator>
inline typename iterator_traits<Iterator>::iterator_category iteratir_category(const Iterator&) { typedef typename iterator_traits<Iterator>::iterator_category category; return category(); } template<typename Iterator> inline typename iterator_traits<Iterator>::distance_type* distance_type(const Iterator&) { return static_cast<typename iterator_traits<Iterator>::distance_type*>(0); } template<typename T> inline typename iterator_traits<Iterator>::value_type* value_type(const Iterator&) { return static_cast<typename iterator_traits<Iterator>::value_type*>(0); } 

概要

適切な設計の種類は、イテレータの責任です。
デザイン適切なイテレータは、容器の責任です。

__type_traits
特性技術はC ++言語自体の不足を補うために、しかし、特性の技術がないだけでも、イテレータでSTLに存在する存在します。iterator_traits責任イテレータの特徴抽出、__ type_traitsは抽出型パラメータを担当しています。ここTypeパラメータにはを参照:このタイプは非自明なデフォルトのctorのを持っていませんか?非自明なコピーctorのかどうか?非travial代入演算子かどうか?非trravial dctorかどうか?そうでない場合、我々は、最も効果的な行動を取るのmemcpy()、MEMMOVE()を使用することができます。それ以外の場合は、その上のCTOR、コピー、dctorとに従って複雑な操作が必要とされています。
次にiterator_traitsに同様の方法を使用することができます。

__type_traits<T>::has_trivial_default_constructor
__type_traits<T>::has_trivial_copy_constructor
__type_traits<T>::has_trivial_assignment_operator
__type_traits<T>::has_trivial_destructor
__type_traits<T>::is_POD_type

struct __true_type {};
struct __false_type {}; template<typename T> 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; }

STLは、セックスの定義に埋め込まれたすべての値の最も保守的で、その後、良識のタイプ(CHAR、長い、int型、ダブル)と他の適切な設計の特殊化を提供します。

__STL_TEMPLATE_NULL struct __type_traits<bool> {
   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 /* __STL_NO_BOOL */ __STL_TEMPLATE_NULL struct __type_traits<char> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<signed char> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned char> { 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; }; #ifdef __STL_HAS_WCHAR_T __STL_TEMPLATE_NULL struct __type_traits<wchar_t> { 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 /* __STL_HAS_WCHAR_T */ __STL_TEMPLATE_NULL struct __type_traits<short> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned short> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<int> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned int> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<long> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned long> { 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; }; #ifdef __STL_LONG_LONG __STL_TEMPLATE_NULL struct __type_traits<long long> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned long long> { 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 /* __STL_LONG_LONG */ __STL_TEMPLATE_NULL struct __type_traits<float> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<double> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<long double> { 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; }; #ifdef __STL_CLASS_PARTIAL_SPECIALIZATION template <class _Tp> struct __type_traits<_Tp*> { 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; }; #else /* __STL_CLASS_PARTIAL_SPECIALIZATION */ __STL_TEMPLATE_NULL struct __type_traits<char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<signed char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<const char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<const signed char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<const unsigned char*> { 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<typename T>
struct Iter { typedef T value_type; .... } template<typename T> typename T::value_type func(T* ite) {return *ite;}

この度は、まだ問題が発生した:それは(例えばポインタ、参照など)クラス型でない場合は、正しいパラメータを導出することはできません。あなたはこのような状況を処理するために、テンプレートの部分特殊化を使用することができます。

template<typename T>
struct Iter<T*> { typename T value_type; };

私たちは、コア問題に対処する必要があります。技術的な特性で説明したイテレータ型が行う取得する方法?

template<typename T>
struct iterator_traits { typedef typename T::iterator_category iterator_category; typedef typename T::value_type value_type; typedef typename T::difference_type difference_type; typedef typename T::pointer pointer; typedef typename T::reference reference; };

同時に、にiterator_traitsは、着信ポインタとポインタツーconstの専門分野を設計するために入力する必要があります。

template<typename T>
struct iterator_traits<T*> { ... typedef random_access_iterator_tag iterator_category; } template<typename T> struct iterator_traits<const T*> { ... typedef random_access_iretator_tag iterator_category; }

入力しないでください。

  • タイプ値:オブジェクト・タイプを指して説明イテレータ。
  • 型-difference 2つの説明イテレータの間の距離、組み込みC ++型ptrdiff_tのデフォルトを使用して
  • Reference型のオブジェクトへの参照説明イテレータ:
  • 型ポインタ:オブジェクト・イテレータへのポインタの説明
  • iterator_category:説明それぞれの性別のイテレータ
    • INPUTをイテレータ:読み取り専用反復子
    • 出力をイテレータ:書き込み専用反復子
    • イテレータフォワード:読み書きイテレータ
    • イテレータ双方向:双方向移動イテレータ、読み書きできます
    • イテレータにランダムアクセスイテレータランダムな動きを読み、書くことができます。

コンパイル時の貫通イテレータの異なるバージョンの機能の異なるバージョンの選択に、オーバーロードを使用:

template<typename category,typename T,typename dis=ptrdiff_t,typename poin=T*,typename ref=T&> struct iterator { typedef category iterator_category; typedef T value_type; typedef dis difference_type; typedef poin pointer; typedef ref reference; }; struct input_iterator_tag {}; struct output_iterator_tag {}; struct forward_iterator_tag : public input_iterator_tag {}; struct bidirectional_iterator_tag : public forward_iterator_tag {}; struct random_access_iterator_tag : public bidirectional_iterator_tag {}; template <typename InputIterator,typename Distance> inline void __advance(InputIterator& iter,Distance n,input_iterator_tag) { while(n--) ++iter; } template <typename ForwardIterator,typename Distance> inline void __advance(ForwardIterator& iter,Distance n,forward_iterator_tag) { __advance(i,n,input_iterator_tag()); } template <typename BidirectionalIterator,typename Distance> inline void __advance(BidirectionalIterator& iter,Distance n,bidirectional_iterator_tag) { if(n > 0) while(n--) ++iter; if(n < 0) while(n--) --iter; } template <typename RandomAccessIterator,typename Distance> inline void __advance(RandomAccessIterator& iter,Distance n,random_access_iterator_tag) { iter += n; }

特性のメカニズムをよると、次のラッパーを使用する必要があります。

template <typename InputIterator,typename Distance>
inline void __advance(InputIterator& iter,Distance n) { __advance(i,n,iteratir_traits<InputIterator>::iterator_category()); }

その他の機能をソーシング:

template<typename Iterator>
inline typename iterator_traits<Iterator>::iterator_category iteratir_category(const Iterator&) { typedef typename iterator_traits<Iterator>::iterator_category category; return category(); } template<typename Iterator> inline typename iterator_traits<Iterator>::distance_type* distance_type(const Iterator&) { return static_cast<typename iterator_traits<Iterator>::distance_type*>(0); } template<typename T> inline typename iterator_traits<Iterator>::value_type* value_type(const Iterator&) { return static_cast<typename iterator_traits<Iterator>::value_type*>(0); } 

概要

適切な設計の種類は、イテレータの責任です。
デザイン適切なイテレータは、容器の責任です。

__type_traits
特性技術はC ++言語自体の不足を補うために、しかし、特性の技術がないだけでも、イテレータでSTLに存在する存在します。iterator_traits責任イテレータの特徴抽出、__ type_traitsは抽出型パラメータを担当しています。ここTypeパラメータにはを参照:このタイプは非自明なデフォルトのctorのを持っていませんか?非自明なコピーctorのかどうか?非travial代入演算子かどうか?非trravial dctorかどうか?そうでない場合、我々は、最も効果的な行動を取るのmemcpy()、MEMMOVE()を使用することができます。それ以外の場合は、その上のCTOR、コピー、dctorとに従って複雑な操作が必要とされています。
次にiterator_traitsに同様の方法を使用することができます。

__type_traits<T>::has_trivial_default_constructor
__type_traits<T>::has_trivial_copy_constructor
__type_traits<T>::has_trivial_assignment_operator
__type_traits<T>::has_trivial_destructor
__type_traits<T>::is_POD_type

struct __true_type {};
struct __false_type {}; template<typename T> 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; }

STLは、セックスの定義に埋め込まれたすべての値の最も保守的で、その後、良識のタイプ(CHAR、長い、int型、ダブル)と他の適切な設計の特殊化を提供します。

__STL_TEMPLATE_NULL struct __type_traits<bool> {
   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 /* __STL_NO_BOOL */ __STL_TEMPLATE_NULL struct __type_traits<char> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<signed char> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned char> { 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; }; #ifdef __STL_HAS_WCHAR_T __STL_TEMPLATE_NULL struct __type_traits<wchar_t> { 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 /* __STL_HAS_WCHAR_T */ __STL_TEMPLATE_NULL struct __type_traits<short> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned short> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<int> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned int> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<long> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned long> { 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; }; #ifdef __STL_LONG_LONG __STL_TEMPLATE_NULL struct __type_traits<long long> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned long long> { 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 /* __STL_LONG_LONG */ __STL_TEMPLATE_NULL struct __type_traits<float> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<double> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<long double> { 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; }; #ifdef __STL_CLASS_PARTIAL_SPECIALIZATION template <class _Tp> struct __type_traits<_Tp*> { 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; }; #else /* __STL_CLASS_PARTIAL_SPECIALIZATION */ __STL_TEMPLATE_NULL struct __type_traits<char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<signed char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<unsigned char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<const char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<const signed char*> { 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; }; __STL_TEMPLATE_NULL struct __type_traits<const unsigned char*> { 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; };

おすすめ

転載: www.cnblogs.com/xcb-1024day/p/11332501.html