// (3) Defines __STL_STATIC_TEMPLATE_MEMBER_BUG if the compiler can't // handle static members of template classes. 没有这个bug // (5) Defines __STL_CLASS_PARTIAL_SPECIALIZATION if the compiler // supports partial specialization of class templates. // (6) Defines __STL_FUNCTION_TMPL_P...
ALLOC_H #define__SGI_STL_INTERNAL_ALLOC_H #ifdef__SUNPRO_CC #define__PRIVATEpublic //Extraaccessrestrictionspreventusfromreallymakingsomethings //private. #else #define__PRIVATEprivate #endif #ifdef__STL_STATIC_TEMPLATE_MEMBER_BUG #define__USE_MALLOC #endif //本檔實作出某些標準的nodeallocators...
侯捷stl源码剖析注释之33 sgi-stl-list
inline void basic_string <charT, traits, Allocator>::Rep:: operator delete(void * ptr) { Allocator::deallocate(ptr, sizeof(Rep) + reinterpret_cast<Rep *>(ptr)->res * sizeof (charT)); } template <class charT, class traits, class Allocator> inline size_t basic_string <charT, traits,...
/* NOTE: This is an internal header file, included by other STL headers. * You should not attempt to use it directly.*/ #ifndef __SGI_STL_INTERNAL_TEMPBUF_H #define __SGI_STL_INTERNAL_TEMPBUF_H __STL_BEGIN_NAMESPACE template <class T> pair<T*, ptrdiff_t> get_temporary_...
#ifndef __SGI_STL_INTERNAL_FUNCTION_H #define __SGI_STL_INTERNAL_FUNCTION_H __STL_BEGIN_NAMESPACE // C++ Standard 規定,每一個 Adaptable Unary Function 都必須繼承此類別 template <class Arg, class Result> struct unary_function { typedef Arg argument_type ;typedef Result result_type ;};...
#define __SGI_STL_INTERNAL_PAIR_H __STL_BEGIN_NAMESPACE template <class T1, class T2> struct pair { typedef T1 first_type ;typedef T2 second_type ; T1 first ; // 注意,它是 public T2 second ; // 注意,它是 public pair() : first(T1()), second(T2()) {} pair(const T1...