template <class Ptr> class pointer_traits; // template template <class T> class pointer_traits<T*>; // template specialization
member type | interpretation | definition in unspecialized pointer_traits | definition in pointer_traits<T*> specialization |
---|---|---|---|
pointer | The pointer type | Template parameter Ptr | T* |
element_type | Type of pointed value | Either Ptr::element_type (if such type exists), or the first template argument used to instantiate Ptr (if Ptr is a class template instantiation). | T |
difference_type | Type resulting from subtracting two elements of type Ptr. | Ptr::difference_type (if such type exists), or std::ptrdiff_t otherwise. | std::ptrdiff_t |
rebind<V> | Type that rebinds to V | Either Ptr::rebind<V> (if such type exists), or an instantiation of the template used to instantiate Ptr, using V as first template parameter instead (if Ptr is a class template instantiation). | V* |
|
|
foo: 1 bar: 2 |