文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 侯捷stl源码剖析注释之21 sgi-stl-alloc
侵权投诉

侯捷stl源码剖析注释之21 sgi-stl-alloc

侯捷stl源码剖析注释

<stl_alloc.h> 完整列表 1

G++ 2.91.57,cygnus\cygwin-b20\include\g++\stl_alloc.h 完整列表

/*

* Copyright (c) 1996-1997

* Silicon Graphics Computer Systems, Inc.

*

* Permission to use, copy, modify, distribute and sell this software

* and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and

* that both that copyright notice and this permission notice appear

* in supporting documentation. Silicon Graphics makes no

* representations about the suitability of this software for any

* purpose. It is provided "as is" without express or implied warranty. */

/* NOTE: This is an internal header file, included by other STL headers. * You should not attempt to use it directly.

*/

#ifndef __SGI_STL_INTERNAL_ALLOC_H

#define __SGI_STL_INTERNAL_ALLOC_H

#ifdef __SUNPRO_CC

# define __PRIVATE public

// Extra access restrictions prevent us from really making some things

// private.

#else

# define __PRIVATE private

#endif

#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG

# define __USE_MALLOC

#endif

// 本檔實作出某些標準的 node allocators。這些配置器與 C++ 標準草稿所描述的

// 或是與原始STL 所描述的都不相同。它們並未封裝不同的指標型別;事實上我們假設

// 只有一種指標型別。一些基本函式用來配置個別物件,物件的大小並不比原始

// STL 配置器所能配置的更大。

#if 0

# include <new>

# define __THROW_BAD_ALLOC throw bad_alloc

#elif !defined(__THROW_BAD_ALLOC)

# include <iostream.h>

# define __THROW_BAD_ALLOC cerr << "out of memory" << endl; exit(1)

#endif

#ifndef __ALLOC

# define __ALLOC alloc

The Annotated STL Sources

第1页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email