STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

stlsoft.h

Go to the documentation of this file.
00001 /* 
00002  * File:        stlsoft.h
00003  *
00004  * Purpose:     Root header for the STLSoft libraries. Performs various compiler
00005  *              and platform discriminations, and definitions of types.
00006  *
00007  * Created:     15th January 2002
00008  * Updated:     11th September 2004
00009  *
00010  * Home:        http://stlsoft.org/
00011  *
00012  * Copyright (c) 2002-2004, Matthew Wilson and Synesis Software
00013  * All rights reserved.
00014  *
00015  * Redistribution and use in source and binary forms, with or without
00016  * modification, are permitted provided that the following conditions are met:
00017  *
00018  * - Redistributions of source code must retain the above copyright notice, this
00019  *   list of conditions and the following disclaimer.
00020  * - Redistributions in binary form must reproduce the above copyright notice,
00021  *   this list of conditions and the following disclaimer in the documentation
00022  *   and/or other materials provided with the distribution.
00023  * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
00024  *   any contributors may be used to endorse or promote products derived from
00025  *   this software without specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00028  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00031  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00032  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00033  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00035  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00036  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00037  * POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  * 
00040 
00041 
00042 #ifndef STLSOFT_INCL_H_STLSOFT
00043 #define STLSOFT_INCL_H_STLSOFT
00044 
00045 /* File version */
00046 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00047 # define STLSOFT_VER_H_STLSOFT_MAJOR    2
00048 # define STLSOFT_VER_H_STLSOFT_MINOR    0
00049 # define STLSOFT_VER_H_STLSOFT_REVISION 1
00050 # define STLSOFT_VER_H_STLSOFT_EDIT     202
00051 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00052 
00109 /* 
00110  * STLSoft version
00111  *
00112  * The libraries version information is comprised of major, minor and revision
00113  * components.
00114  *
00115  * The major version is denoted by the _STLSOFT_VER_MAJOR preprocessor symbol.
00116  * A changes to the major version component implies that a dramatic change has
00117  * occured in the libraries, such that considerable changes to source dependent
00118  * on previous versions would need to be effected.
00119  *
00120  * The minor version is denoted by the _STLSOFT_VER_MINOR preprocessor symbol.
00121  * Changes to the minor version component imply that a significant change has
00122  * occured to the libraries, either in the addition of new functionality or in
00123  * the destructive change to one or more components such that recomplilation and
00124  * code change may be necessitated.
00125  *
00126  * The revision version is denoted by the _STLSOFT_VER_REVISIO preprocessor
00127  * symbol. Changes to the revision version component imply that a bug has been
00128  * fixed. Dependent code should be recompiled in order to pick up the changes.
00129  *
00130  * In addition to the individual version symbols - _STLSOFT_VER_MAJOR,
00131  * _STLSOFT_VER_MINOR and _STLSOFT_VER_REVISION - a composite symbol _STLSOFT_VER
00132  * is defined, where the upper 8 bits are 0, bits 16-23 represent the major
00133  * component,  bits 8-15 represent the minor component, and bits 0-7 represent
00134  * the revision component.
00135  *
00136  * Each release of the libraries will bear a different version, and that version
00137  * will also have its own symbol: Version 1.0.1 specifies _STLSOFT_VER_1_0_1.
00138  *
00139  * Thus the symbol _STLSOFT_VER may be compared meaningfully with a specific
00140  * version symbol, e.g.# if _STLSOFT_VER >= _STLSOFT_VER_1_0_1
00141  */
00142 
00145 
00148 
00151 
00154 
00155 #define _STLSOFT_VER_MAJOR      1
00156 #define _STLSOFT_VER_MINOR      8
00157 #define _STLSOFT_VER_REVISION   1
00158 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00159 # define _STLSOFT_VER_1_0_1     0x00010001  
00160 # define _STLSOFT_VER_1_0_2     0x00010002  
00161 # define _STLSOFT_VER_1_1_1     0x00010101  
00162 # define _STLSOFT_VER_1_1_2     0x00010102  
00163 # define _STLSOFT_VER_1_1_3     0x00010103  
00164 # define _STLSOFT_VER_1_2_1     0x00010201  
00165 # define _STLSOFT_VER_1_3_1     0x00010301  
00166 # define _STLSOFT_VER_1_3_2     0x00010302  
00167 # define _STLSOFT_VER_1_4_1     0x00010401  
00168 # define _STLSOFT_VER_1_4_2     0x00010402  
00169 # define _STLSOFT_VER_1_4_3     0x00010403  
00170 # define _STLSOFT_VER_1_4_4     0x00010404  
00171 # define _STLSOFT_VER_1_4_5     0x00010405  
00172 # define _STLSOFT_VER_1_4_6     0x00010406  
00173 # define _STLSOFT_VER_1_5_1     0x00010501  
00174 # define _STLSOFT_VER_1_5_2     0x00010502  
00175 # define _STLSOFT_VER_1_6_1     0x00010601  
00176 # define _STLSOFT_VER_1_6_2     0x00010602  
00177 # define _STLSOFT_VER_1_6_3     0x00010603  
00178 # define _STLSOFT_VER_1_6_4     0x00010604  
00179 # define _STLSOFT_VER_1_6_5     0x00010605  
00180 # define _STLSOFT_VER_1_6_6     0x00010606  
00181 # define _STLSOFT_VER_1_7_1     0x00010701  
00182 # define _STLSOFT_VER_1_7_2     0x00010702  
00183 # define _STLSOFT_VER_1_8_1     0x00010801  
00184 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00185 
00186 #define _STLSOFT_VER            _STLSOFT_VER_1_8_1
00187 
00188 /* 
00189  * Basic macros
00190  */
00191 
00192 /* Compilation messages
00193  *
00194  * To see certain informational messages during compilation define the
00195  * preprocessor symbol _STLSOFT_COMPILE_VERBOSE
00196  */
00197 
00198 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00199 # define STLSOFT_STRINGIZE_(x)      #x
00200 # define STLSOFT_STRINGIZE(x)       STLSOFT_STRINGIZE_(x)
00201 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00202 
00203 /* Simple macro indirection
00204  */
00205 
00206 #define STLSOFT_MACRO_INDIRECT(x)   x
00207 
00208 /* 
00209  * Sanity checks - 1
00210  *
00211  * C++      -   must be C++ compilation unit
00212  */
00213 
00214 /* Must be C++. */
00215 #ifndef __cplusplus
00216 # error The STLSoft libraries are only compatible with C++ compilation units
00217 #endif /* __cplusplus */
00218 
00219 /* 
00220  * Compiler compatibility
00221  *
00222  * Currently the only compilers supported by the STLSoft libraries are
00223  *
00224  * Borland C++ 5.5, 5.51 & 5.6
00225  * Comeau 4.3.1
00226  * Digital Mars C/C++ 8.26 and above
00227  * GCC 2.95, 2.96 & 3.2
00228  * Intel C/C++ 6.0 & 7.0
00229  * Metrowerks 2.4 & 3.0 (CodeWarrior 7.0 & 8.0)
00230  * Visual C++ 4.2, 5.0, 6.0 & .NET
00231  * Watcom C/C++ 11.0
00232  *
00233  * The following compilers are intended to be supported in a future release:
00234  *
00235  * Comeau C++
00236  */
00237 
00238 #ifdef __STLSOFT_COMPILER_IS_UNKNOWN
00239 # undef __STLSOFT_COMPILER_IS_UNKNOWN
00240 #endif /* __STLSOFT_COMPILER_IS_UNKNOWN */
00241 
00242 #ifdef __STLSOFT_COMPILER_IS_BORLAND
00243 # undef __STLSOFT_COMPILER_IS_BORLAND
00244 #endif /* __STLSOFT_COMPILER_IS_BORLAND */
00245 
00246 #ifdef __STLSOFT_COMPILER_IS_COMO
00247 # undef __STLSOFT_COMPILER_IS_COMO
00248 #endif /* __STLSOFT_COMPILER_IS_COMO */
00249 
00250 #ifdef __STLSOFT_COMPILER_IS_DMC
00251 # undef __STLSOFT_COMPILER_IS_DMC
00252 #endif /* __STLSOFT_COMPILER_IS_DMC */
00253 
00254 #ifdef __STLSOFT_COMPILER_IS_GCC
00255 # undef __STLSOFT_COMPILER_IS_GCC
00256 #endif /* __STLSOFT_COMPILER_IS_GCC */
00257 
00258 #ifdef __STLSOFT_COMPILER_IS_INTEL
00259 # undef __STLSOFT_COMPILER_IS_INTEL
00260 #endif /* __STLSOFT_COMPILER_IS_INTEL */
00261 
00262 #ifdef __STLSOFT_COMPILER_IS_MSVC
00263 # undef __STLSOFT_COMPILER_IS_MSVC
00264 #endif /* __STLSOFT_COMPILER_IS_MSVC */
00265 
00266 #ifdef __STLSOFT_COMPILER_IS_MWERKS
00267 # undef __STLSOFT_COMPILER_IS_MWERKS
00268 #endif /* __STLSOFT_COMPILER_IS_MWERKS */
00269 
00270 #ifdef __STLSOFT_COMPILER_IS_VECTORC
00271 # undef __STLSOFT_COMPILER_IS_VECTORC
00272 #endif /* __STLSOFT_COMPILER_IS_VECTORC */
00273 
00274 #ifdef __STLSOFT_COMPILER_IS_WATCOM
00275 # undef __STLSOFT_COMPILER_IS_WATCOM
00276 #endif /* __STLSOFT_COMPILER_IS_WATCOM */
00277 
00278 /* First we do a check to see whether other compilers are providing
00279  * compatibility with Visual C++, and handle that.
00280  */
00281 
00282 #ifdef _MSC_VER
00283 # if defined(__BORLANDC__) ||      /* Borland C/C++ */ \
00284      defined(__COMO__) ||          /* Comeau C/C++ */ \
00285      defined(__DMC__) ||           /* Digital Mars C/C++ */ \
00286      defined(__GNUC__) ||          /* GNU C/C++ */ \
00287      defined(__INTEL_COMPILER) ||  /* Intel C/C++ */ \
00288      defined(__MWERKS__) ||        /* Metrowerks C/C++ */ \
00289      defined(__WATCOMC__)          /* Watcom C/C++ */
00290   /* Handle Microsoft Visual C++ support. */
00291 #  if defined(_STLSOFT_NO_MSC_VER_SUPPORT) || \
00292      (   defined(_STLSOFT_STRICT) && \
00293          !defined(_STLSOFT_MSC_VER_SUPPORT))
00294 #   undef _MSC_VER
00295 #  endif /* _STLSOFT_NO_MSC_VER_SUPPORT || (_STLSOFT_STRICT && _STLSOFT_MSC_VER_SUPPORT) */
00296 # endif /* compiler */
00297 #endif /* _MSC_VER */
00298 
00299 #if defined(_STLSOFT_FORCE_CUSTOM_COMPILER)
00300 # define __STLSOFT_COMPILER_LABEL_STRING        "Custom (forced) compiler"
00301 # define __STLSOFT_COMPILER_VERSION_STRING      "Custom (forced) compiler"
00302 # define __STLSOFT_COMPILER_IS_CUSTOM
00303 # ifndef __STLSOFT_CF_CUSTOM_COMPILER_INCLUDE_NAME
00304 #  error When using the custom compiler option you must define the symbol __STLSOFT_CF_CUSTOM_COMPILER_INCLUDE_NAME, e.g. #define __STLSOFT_CF_CUSTOM_COMPILER_INCLUDE_NAME <stlsoft_cccap_my_compiler.h>
00305 # endif /* !__STLSOFT_CF_CUSTOM_COMPILER_INCLUDE_NAME */
00306 
00307 #elif defined(__COMO__) /* Do Comeau next, so that no Comeau back-end server compilers are preferentially discriminated */
00308 /* Comeau C++ */
00309 # define __STLSOFT_COMPILER_IS_COMO
00310 # define __STLSOFT_COMPILER_LABEL_STRING        "Comeau C++"
00311 # if __COMO_VERSION__ < 4300
00312 #  error Only versions 4.3.0.1 and later of Comeau C++ compiler is supported by the STLSoft libraries
00313 # elif (__COMO_VERSION__ == 4300)
00314 #  define __STLSOFT_COMPILER_VERSION_STRING "Comeau C++ 4.3.0.1"
00315 # else
00316 #  define __STLSOFT_COMPILER_VERSION_STRING "Unknown version of Comeau C++"
00317 # endif /* __COMO_VERSION__ */
00318 
00319 #elif defined(__BORLANDC__)
00320 /* Borland C++ */
00321 # define __STLSOFT_COMPILER_IS_BORLAND
00322 # define __STLSOFT_COMPILER_LABEL_STRING        "Borland C/C++"
00323 # if 0 /* (__BORLANDC__ == 0x0460) */
00324 #  define __STLSOFT_COMPILER_VERSION_STRING     "Borland C++ 4.52"
00325 # elif 0 /* (__BORLANDC__ == 0x0550) */
00326 #  define __STLSOFT_COMPILER_VERSION_STRING     "Borland C++ 5.5"
00327 # elif (__BORLANDC__ == 0x0551)
00328 #  define __STLSOFT_COMPILER_VERSION_STRING     "Borland C++ 5.51"
00329 # elif (__BORLANDC__ == 0x0560)
00330 #  define __STLSOFT_COMPILER_VERSION_STRING     "Borland C++ 5.6"
00331 # elif (__BORLANDC__ == 0x0564)
00332 #  define __STLSOFT_COMPILER_VERSION_STRING     "Borland C++ 5.64 (C++ BuilderX)"
00333 # else
00334   /*# error Currently only versions 4.52, 5.5, 5.51 and 5.6 of the Borland C++ compiler are supported by the STLSoft libraries */
00335 #  error Currently only versions 5.51, 5.6 and 5.6.4 of the Borland C++ compiler are supported by the STLSoft libraries
00336 # endif /* __BORLANDC__ */
00337 
00338 #elif defined(__DMC__)
00339 /* Digital Mars C/C++ */
00340 # define __STLSOFT_COMPILER_IS_DMC
00341 # define __STLSOFT_COMPILER_LABEL_STRING        "Digital Mars C/C++"
00342 # if (__DMC__ < 0x0826)
00343 #  error Only versions 8.26 and later of the Digital Mars C/C++ compilers are supported by the STLSoft libraries
00344 # else
00345 #  if __DMC__ >= 0x0832
00346 #   define __STLSOFT_COMPILER_VERSION_STRING    __DMC_VERSION_STRING__
00347 #  elif (__DMC__ == 0x0826)
00348 #   define __STLSOFT_COMPILER_VERSION_STRING    "Digital Mars C/C++ 8.26"
00349 #  elif (__DMC__ == 0x0827)
00350 #   define __STLSOFT_COMPILER_VERSION_STRING    "Digital Mars C/C++ 8.27"
00351 #  elif (__DMC__ == 0x0828)
00352 #   define __STLSOFT_COMPILER_VERSION_STRING    "Digital Mars C/C++ 8.28"
00353 #  elif (__DMC__ == 0x0829)
00354 #   define __STLSOFT_COMPILER_VERSION_STRING    "Digital Mars C/C++ 8.29"
00355 #  elif (__DMC__ == 0x0830)
00356 #   define __STLSOFT_COMPILER_VERSION_STRING    "Digital Mars C/C++ 8.30"
00357 #  elif (__DMC__ == 0x0831)
00358 #   define __STLSOFT_COMPILER_VERSION_STRING    "Digital Mars C/C++ 8.31"
00359 #  endif /* __DMC__ */
00360 # endif /* version */
00361 
00362 #elif defined(__INTEL_COMPILER)
00363 /* Intel C++ */
00364 # define __STLSOFT_COMPILER_IS_INTEL
00365 # define __STLSOFT_COMPILER_LABEL_STRING        "Intel C/C++"
00366 # if (__INTEL_COMPILER == 600)
00367 #  define __STLSOFT_COMPILER_VERSION_STRING     "Intel C/C++ 6.0"
00368 # elif (__INTEL_COMPILER == 700)
00369 #  define __STLSOFT_COMPILER_VERSION_STRING     "Intel C/C++ 7.0"
00370 # elif (__INTEL_COMPILER == 800)
00371 #  define __STLSOFT_COMPILER_VERSION_STRING     "Intel C/C++ 8.0"
00372 # else
00373 #  error Only Intel C++ Compiler versions 6.0 and 7.0 currently supported by the STLSoft libraries
00374 # endif /* __INTEL_COMPILER */
00375 
00376 #elif defined(__GNUC__)
00377 /* GNU C/C++ */
00378 # define __STLSOFT_COMPILER_IS_GCC
00379 # define __STLSOFT_COMPILER_LABEL_STRING        "GNU C/C++"
00380 # if __GNUC__ != 2 && \
00381      __GNUC__ != 3
00382 #  error GNU C/C++ compilers whose major version is not 2 or 3 are not currently supported by the STLSoft libraries
00383 # elif __GNUC__ == 2
00384 #  if __GNUC_MINOR__ < 95
00385 #   error Currently only version 2.95 and above of the GNU C/C++ compiler is supported by the STLSoft libraries
00386 #  elif __GNUC_MINOR__ == 95
00387 #   define __STLSOFT_COMPILER_VERSION_STRING    "GNU C/C++ 2.95"
00388 #  elif __GNUC_MINOR__ == 96
00389 #   define __STLSOFT_COMPILER_VERSION_STRING    "GNU C/C++ 2.96"
00390 #  else
00391 #   define __STLSOFT_COMPILER_VERSION_STRING    "GNU C/C++ >2.96 - you should be aware that this version may not be supported correctly"
00392 #  endif /* __GNUC__ != 2 */
00393 # elif __GNUC__ == 3
00394 #  if __GNUC_MINOR__ == 2
00395 #   define __STLSOFT_COMPILER_VERSION_STRING    "GNU C/C++ 3.2"
00396 #  elif __GNUC_MINOR__ == 3
00397 #   define __STLSOFT_COMPILER_VERSION_STRING    "GNU C/C++ 3.3"
00398 #  elif __GNUC_MINOR__ == 4
00399 #   define __STLSOFT_COMPILER_VERSION_STRING    "GNU C/C++ 3.4"
00400 #  else
00401 #   define __STLSOFT_COMPILER_VERSION_STRING    "GNU C/C++ >3.4 - you should be aware that this version may not be supported correctly"
00402 #  endif /* __GNUC__ != 2 */
00403 # endif /* __GNUC__ */
00404 
00405 #elif defined(__MWERKS__)
00406 /* Metrowerks C++ */
00407 # define __STLSOFT_COMPILER_IS_MWERKS
00408 # define __STLSOFT_COMPILER_LABEL_STRING        "Metrowerks CodeWarrior C/C++"
00409 # if ((__MWERKS__ & 0xFF00) == 0x2400)
00410 #  define __STLSOFT_COMPILER_VERSION_STRING     "Metrowerks CodeWarrior C++ 2.4"
00411 # elif ((__MWERKS__ & 0xFF00) == 0x3000)
00412 #  define __STLSOFT_COMPILER_VERSION_STRING     "Metrowerks CodeWarrior C++ 3.0"
00413 # elif ((__MWERKS__ & 0xFF00) == 0x3200)
00414 #  define __STLSOFT_COMPILER_VERSION_STRING     "Metrowerks CodeWarrior C++ 3.2"
00415 # else
00416 #  error Only Metrowerks C++ Compiler 2.4 (CodeWarrior 7), 3.0 (CodeWarrior 8) and 3.2 (CodeWarrior 9) currently supported by the STLSoft libraries
00417 # endif /* __MWERKS__ */
00418 
00419 #elif defined(__VECTORC)
00420 /* CodePlay Vector C/C++ */
00421 # define __STLSOFT_COMPILER_IS_VECTORC
00422 # define __STLSOFT_COMPILER_LABEL_STRING        "CodePlay VectorC C/C++"
00423 # if (__VECTORC == 1)
00424 #  define __STLSOFT_COMPILER_VERSION_STRING     "CodePlay VectorC C/C++"
00425 # else
00426 #  error Currently only versions of the CodePlay Vector C/C++ compiler defining __VECTORC == 1 are supported by the STLSoft libraries
00427 # endif /* __VECTORC */
00428 
00429 #elif defined(__WATCOMC__)
00430 /* Watcom C/C++ */
00431 # define __STLSOFT_COMPILER_IS_WATCOM
00432 # define __STLSOFT_COMPILER_LABEL_STRING        "Watcom C/C++"
00433 
00434 # if (__WATCOMC__ == 1100)
00435 #  define __STLSOFT_COMPILER_VERSION_STRING     "Watcom C/C++ 11.0"
00436 # elif (__WATCOMC__ == 1200)
00437 #  define __STLSOFT_COMPILER_VERSION_STRING     "Open Watcom C/C++ 1.0 (Watcom 12.0)"
00438 # elif (__WATCOMC__ == 1210)
00439 #  define __STLSOFT_COMPILER_VERSION_STRING     "Open Watcom C/C++ 1.1 (Watcom 12.1)"
00440 # elif (__WATCOMC__ == 1220)
00441 #  define __STLSOFT_COMPILER_VERSION_STRING     "Open Watcom C/C++ 1.2 (Watcom 12.2)"
00442 # else
00443 #  error Currently only versions 11.0 and 12.0 of the Watcom C/C++ compiler is supported by the STLSoft libraries
00444 # endif /* __WATCOMC__ */
00445 
00446 #elif defined(_MSC_VER)
00447 /* Visual C++ */
00448 # define __STLSOFT_COMPILER_IS_MSVC
00449 # define __STLSOFT_COMPILER_LABEL_STRING        "Visual C++"
00450 # if 0 /* (_MSC_VER == 1020) */
00451 #  define __STLSOFT_COMPILER_VERSION_STRING     "Visual C++ 4.2"
00452 # elif (_MSC_VER == 1100)
00453 #  define __STLSOFT_COMPILER_VERSION_STRING     "Visual C++ 5.0"
00454 # elif (_MSC_VER == 1200)
00455 #  define __STLSOFT_COMPILER_VERSION_STRING     "Visual C++ 6.0"
00456 # elif (_MSC_VER == 1300)
00457 #  define __STLSOFT_COMPILER_VERSION_STRING     "Visual C++ .NET (7.0)"
00458 # elif (_MSC_VER == 1310)
00459 #  define __STLSOFT_COMPILER_VERSION_STRING     "Visual C++ .NET (7.1)"
00460 # elif (_MSC_VER == 1400)
00461 #  define __STLSOFT_COMPILER_VERSION_STRING     "Visual C++ .NET (8.0)"
00462 # else
00463 #  error Currently only versions 5.0, 6.0, 7.0, 7.1 & 8.0 of the Visual C++ compiler are supported by the STLSoft libraries
00464 # endif /* _MSC_VER */
00465 
00466 #else
00467 /* No recognised compiler */
00468 # if defined(_STLSOFT_FORCE_UNKNOWN_COMPILER) || \
00469      defined(_STLSOFT_FORCE_ANY_COMPILER)
00470 #  define __STLSOFT_COMPILER_LABEL_STRING       "Unknown (forced) compiler"
00471 #  define __STLSOFT_COMPILER_VERSION_STRING     "Unknown (forced) compiler"
00472 #  define __STLSOFT_COMPILER_IS_UNKNOWN
00473 # else
00474 #  error Compiler is not recognised.
00475 #  error Currently only Borland C++, Comeau C++, Digital Mars C/C++, GNU C/C++,
00476 #  error  Intel C/C++, Metrowerks CodeWarrior, Visual C++ and Watcom C/C++
00477 #  error  compilers are supported by the STLSoft libraries
00478 #  error If you want to use the libraries with your compiler, you may specify the
00479 #  error  _STLSOFT_FORCE_CUSTOM_COMPILER or _STLSOFT_FORCE_ANY_COMPILER pre-processor
00480 #  error  symbols.
00481 #  error _STLSOFT_FORCE_ANY_COMPILER assumes that your compiler can support all
00482 #  error  modern C++ compiler features, and causes the inclusion of the compiler
00483 #  error  features file stlsoft_cccap_unknown.h, which is provided by STLSoft.
00484 #  error _STLSOFT_FORCE_CUSTOM_COMPILER requires that you specify the name of the
00485 #  error  compiler features file in __STLSOFT_CF_CUSTOM_COMPILER_INCLUDE_NAME.
00486 #  error The idea is to use _STLSOFT_FORCE_ANY_COMPILER, to determine what language
00487 #  error  features your compiler can support, and then copy, edit and use that file
00488 #  error  via _STLSOFT_FORCE_CUSTOM_COMPILER and __STLSOFT_CF_CUSTOM_COMPILER_INCLUDE_NAME.
00489 # endif /* _STLSOFT_FORCE_ANY_COMPILER */
00490 
00491 #endif /* compiler tag */
00492 
00493 /* 
00494  * Compiler language feature support
00495  *
00496  * Various compilers support the language differently (or not at all), so these
00497  * features are discriminated here and utilised by various means within the code
00498  * in order to minimise the use of the preprocessor conditionals in the other
00499  * libraries' source code.
00500  */
00501 
00502 #if defined(_STLSOFT_INCLUDE_UNDEFS) || \
00503     (  defined(_STLSOFT_STRICT) && \
00504        !defined(STLSOFT_NO_UNDEFS))
00505 # include "stlsoft__undefs.h"
00506 #endif /* _STLSOFT_INCLUDE_UNDEFS) || (_STLSOFT_STRICT) && !STLSOFT_NO_UNDEFS) */
00507 
00508 /* Now we include the appropriate compiler-specific header */
00509 
00510 #if defined(__STLSOFT_COMPILER_IS_CUSTOM)
00511 # include __STLSOFT_CF_CUSTOM_COMPILER_INCLUDE_NAME
00512 #elif defined(__STLSOFT_COMPILER_IS_UNKNOWN)
00513 # include "stlsoft_cccap_unknown.h"
00514 #elif defined(__STLSOFT_COMPILER_IS_BORLAND)
00515 # include "stlsoft_cccap_borland.h"
00516 #elif defined(__STLSOFT_COMPILER_IS_COMO)
00517 # include "stlsoft_cccap_como.h"
00518 #elif defined(__STLSOFT_COMPILER_IS_DMC)
00519 # include "stlsoft_cccap_dmc.h"
00520 #elif defined(__STLSOFT_COMPILER_IS_GCC)
00521 # include "stlsoft_cccap_gcc.h"
00522 #elif defined(__STLSOFT_COMPILER_IS_INTEL)
00523 # include "stlsoft_cccap_intel.h"
00524 #elif defined(__STLSOFT_COMPILER_IS_MSVC)
00525 # include "stlsoft_cccap_msvc.h"
00526 #elif defined(__STLSOFT_COMPILER_IS_MWERKS)
00527 # include "stlsoft_cccap_mwerks.h"
00528 #elif defined(__STLSOFT_COMPILER_IS_VECTORC)
00529 # include "stlsoft_cccap_vectorc.h"
00530 #elif defined(__STLSOFT_COMPILER_IS_WATCOM)
00531 # include "stlsoft_cccap_watcom.h"
00532 #else
00533 # error Compiler not correctly discriminated
00534 #endif /* compiler */
00535 
00536 #if defined(_STLSOFT_COMPILE_VERBOSE) && \
00537     !defined(STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT)
00538 # undef _STLSOFT_COMPILE_VERBOSE
00539 # endif /* !STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT && _STLSOFT_COMPILE_VERBOSE */
00540 
00541 # ifdef _STLSOFT_COMPILE_VERBOSE
00542 #  pragma message(__STLSOFT_COMPILER_VERSION_STRING)
00543 # endif /* STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT && _STLSOFT_COMPILE_VERBOSE */
00544 
00545 /* 
00546  * Sanity checks - 2
00547  *
00548  * MBCS     -   none of the libraries code is written to support MBCS
00549  */
00550 
00551 /* Should not be MBCS.
00552  *
00553  * Only ANSI and Unicode character encoding schemese are explicitly supported.
00554  */
00555 #ifdef _MBCS
00556 # ifdef _STLSOFT_STRICT
00557 #  error The STLSoft libraries are not compatible with variable length character representation schemes such as MBCS
00558 # else
00559 #  ifdef _STLSOFT_COMPILE_VERBOSE
00560 #   pragma message("The STLSoft libraries are not compatible with variable length character representation schemes such as MBCS")
00561 #  endif /* _STLSOFT_COMPILE_VERBOSE */
00562 # endif /* _STLSOFT_STRICT */
00563 #endif /* _MBCS */
00564 
00565 
00566 
00567 /* Template support */
00568 #ifndef __STLSOFT_CF_TEMPLATE_SUPPORT
00569 # error Template support not detected. STLSoft libraries are template-based and require this support.
00570 #endif /* __STLSOFT_CF_TEMPLATE_SUPPORT */
00571 
00572 
00573 /* Native 64-bit integer support */
00574 #if !defined(STLSOFT_CF_64BIT_INT_SUPPORT) && \
00575     (   defined(STLSOFT_CF_64BIT_INT_IS___int64) || \
00576         defined(STLSOFT_CF_64BIT_INT_IS_long_long))
00577 # error Definition for 64-bit support is not correct. STLSOFT_CF_64BIT_INT_SUPPORT must be defined for 64-bit support
00578 #endif /* !STLSOFT_CF_64BIT_INT_SUPPORT && (STLSOFT_CF_64BIT_INT_IS___int64 || STLSOFT_CF_64BIT_INT_IS_long_long) */
00579 
00580 /* Out-of-class method definition argument full-qualification requirement */
00581 #ifdef __STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED
00582 # define stlsoft_oom_fn_qual(Q, T)      Q::T
00583 #else
00584 # define stlsoft_oom_fn_qual(Q, T)      T
00585 #endif /* __STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED */
00586 
00587 /* Out-of-memory throws bad_alloc.
00588  *
00589  * Discriminated symbol is __STLSOFT_CF_NOTHROW_BAD_ALLOC
00590  *
00591  * By default, compilations with the Borland, and Watcom compilers throw
00592  * bad_alloc in conditions of memory exhaustion, and those with Digital Mars
00593  * and Microsoft do not.
00594  *
00595  * The Microsoft compilers do not throw bad_alloc for long established reasons,
00596  * though they can be made to do so (see Matthew Wilson, "Generating
00597  * Out-Of-Memory Exceptions", Windows Developer's Journal, Vol 12 Number 5, May
00598  * 2001). This feature may be added in a forthcoming release of the libraries.
00599  *
00600  * The Digital Mars compiler appears to ship without any header files that
00601  * define bad_alloc (whether in std or not), so it is therefore assumed that
00602  * operator new will not throw exceptions in out of memory conditions.
00603  *
00604  * Define __STLSOFT_CF_THROW_BAD_ALLOC to force Microsoft to do so.
00605  * Define __STLSOFT_CF_NO_THROW_BAD_ALLOC to prevent Borland/Comeau/Digital Mars/
00606  * GCC/Metrowerks/Watcom from doing so.
00607  */
00608 
00609 #ifndef __STLSOFT_CF_EXCEPTION_SUPPORT
00610 # define __STLSOFT_CF_NOTHROW_BAD_ALLOC
00611 #endif /* !__STLSOFT_CF_EXCEPTION_SUPPORT */
00612 
00613 #ifdef __STLSOFT_CF_NOTHROW_BAD_ALLOC
00614 # ifdef __STLSOFT_CF_THROW_BAD_ALLOC
00615 #  undef __STLSOFT_CF_THROW_BAD_ALLOC
00616 # endif /* __STLSOFT_CF_THROW_BAD_ALLOC */
00617 #else
00618  /* Leave it to whatever the compiler's capability discrimination has determined */
00619 #endif /* __STLSOFT_CF_NOTHROW_BAD_ALLOC */
00620 
00621 
00622 /* Template specialisation syntax support
00623  */
00624 #ifdef __STLSOFT_TEMPLATE_SPECIALISATION
00625 # undef __STLSOFT_TEMPLATE_SPECIALISATION
00626 #endif /* __STLSOFT_TEMPLATE_SPECIALISATION */
00627 
00628 #ifdef __STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX
00629 # define STLSOFT_TEMPLATE_SPECIALISATION                template <>
00630 #else
00631 # define STLSOFT_TEMPLATE_SPECIALISATION
00632 #endif /* __STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX */
00633 
00634 
00635 /* Keyword support.
00636  *
00637  * Define _STLSOFT_FORCE_ALL_KEYWORDS to force the assumption of compiler
00638  * support for all keywords.
00639  *
00640  * Define _STLSOFT_FORCE_KEYWORD_EXPLICIT to force the assumption of compiler
00641  * support for the explicit keyword
00642  *
00643  * Define _STLSOFT_FORCE_KEYWORD_MUTABLE to force the assumption of compiler
00644  * support for the mutable keyword
00645  *
00646  * Define _STLSOFT_FORCE_KEYWORD_TYPENAME to force the assumption of compiler
00647  * support for the typename keyword
00648  */
00649 
00650 #ifdef _STLSOFT_FORCE_ALL_KEYWORDS
00651 # define _STLSOFT_FORCE_KEYWORD_EXPLICIT
00652 # define _STLSOFT_FORCE_KEYWORD_MUTABLE
00653 # define _STLSOFT_FORCE_KEYWORD_TYPENAME
00654 #endif /* _STLSOFT_FORCE_ALL_KEYWORDS */
00655 
00656 #if !defined(__STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT) && \
00657     defined(_STLSOFT_FORCE_KEYWORD_EXPLICIT)
00658 # define __STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
00659 #endif /* !__STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT && _STLSOFT_FORCE_KEYWORD_EXPLICIT */
00660 
00661 #if !defined(__STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT) && \
00662     defined(_STLSOFT_FORCE_KEYWORD_MUTABLE)
00663 # define __STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
00664 #endif /* !__STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT && _STLSOFT_FORCE_KEYWORD_MUTABLE */
00665 
00666 #if !defined(__STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT) && \
00667     defined(_STLSOFT_FORCE_KEYWORD_TYPENAME)
00668 # define __STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
00669 #endif /* !__STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT && _STLSOFT_FORCE_KEYWORD_TYPENAME */
00670 
00671 #if !defined(__STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT) && \
00672     defined(_STLSOFT_FORCE_KEYWORD_TYPENAME)
00673 # define __STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
00674 #endif /* !__STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT && _STLSOFT_FORCE_KEYWORD_TYPENAME */
00675 
00676 #if !defined(__STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT) && \
00677     defined(_STLSOFT_FORCE_KEYWORD_TYPENAME)
00678 # define __STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
00679 #endif /* !__STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT && _STLSOFT_FORCE_KEYWORD_TYPENAME */
00680 
00681 #if !defined(__STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT) && \
00682     defined(_STLSOFT_FORCE_KEYWORD_TYPENAME)
00683 # define __STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT
00684 #endif /* !__STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT && _STLSOFT_FORCE_KEYWORD_TYPENAME */
00685 
00686 /* 
00687  * operator bool()
00688  *
00689  * If the symbol STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
00690  * is defined, operator bool should be defined as follows:
00691  *
00692  *  class X
00693  *  {
00694  *  private:
00695  *    struct boolean { int i; }
00696  *    typedef int boolean::*boolean_t;
00697  *  public:
00698  *    operator boolean_t () const;
00699  *
00700  * otherwise it should be
00701  *
00702  *  class X
00703  *  {
00704  *  private:
00705  *    typedef ss_bool_t boolean_t;
00706  *  public:
00707  *    operator boolean_t () const;
00708  *
00709  *
00710  * If the symbol STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
00711  * is defined, it means that (!x) can de deduced by the compiler, otherwise it
00712  * will need to be provided
00713  *
00714  * If STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT is not defined
00715  * then STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT should not be
00716  * defined, so we do a check here.
00717  *
00718  */
00719 
00720 #if !defined(STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT) && \
00721     defined(STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT)
00722 # error Cannot rely on use of boolean as pointer to member for operator !
00723 # error Undefine STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT when
00724 # error STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT is not defined
00725 #endif /* !STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT && STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */
00726 
00727 /* 
00728  * Obsolete symbol definitions
00729  *
00730  * Define _STLSOFT_INCLUDE_OBSOLETE to include the definitions of symbols prior
00731  * to version 1.5.1
00732  */
00733 
00734 /* Verify that the significant changes to STLSoft 1.5.1 are checked with respect
00735  * to other previously released projects
00736  */
00737 
00738 #if (   defined(_ATLSTL_VER) && \
00739         _ATLSTL_VER <= 0x00010204) || \
00740     (   defined(_COMSTL_VER) && \
00741         _COMSTL_VER <= 0x00010201) || \
00742     (   defined(_MFCSTL_VER) && \
00743         _MFCSTL_VER <= 0x00010202) || \
00744     (   defined(_UNIXSTL_VER) && \
00745         _UNIXSTL_VER <= 0x00000901) || \
00746     (   defined(_WINSTL_VER) && \
00747         _WINSTL_VER <= 0x00010201)
00748 # ifdef _STLSOFT_STRICT
00749 #  error You are using an old version of one or more of ATLSTL, COMSTL, MFCSTL, UNIXSTL and WinSTL. Please upgrade all dependent projects in line with the STLSoft version you are using
00750 # else
00751 #  ifdef _STLSOFT_COMPILE_VERBOSE
00752 #   pragma message("You are using an old version of one or more of ATLSTL, COMSTL, MFCSTL, UNIXSTL and WinSTL. _STLSOFT_INCLUDE_OBSOLETE will be defined (but is not guaranteed to work!)")
00753 #  endif /* _STLSOFT_COMPILE_VERBOSE */
00754 #  ifndef _STLSOFT_INCLUDE_OBSOLETE
00755 #   define _STLSOFT_INCLUDE_OBSOLETE
00756 #  endif /* !_STLSOFT_INCLUDE_OBSOLETE */
00757 # endif /* _STLSOFT_STRICT */
00758 #endif /* sub-project versions */
00759 
00760 #ifdef _STLSOFT_INCLUDE_OBSOLETE
00761 # include "stlsoft_cc_obsolete.h"
00762 #endif /* _STLSOFT_INCLUDE_OBSOLETE */
00763 
00764 /* 
00765  * Includes
00766  */
00767 
00768 #ifndef _STLSOFT_NO_STD_INCLUDES
00769 # include <stddef.h>    // standard types
00770 # include <stdlib.h>    // standard constants
00771 #endif /* !_STLSOFT_NO_STD_INCLUDES */
00772 
00773 /* 
00774  * Debugging
00775  *
00776  * The macro stlsoft_assert provides standard debug-mode assert functionality.
00777  */
00778 
00779 #if defined(_STLSOFT_NO_ASSERT) && \
00780     defined(__STLSOFT_CF_ASSERT_SUPPORT)
00781 # undef __STLSOFT_CF_ASSERT_SUPPORT
00782 #endif /* _STLSOFT_NO_ASSERT && __STLSOFT_CF_ASSERT_SUPPORT */
00783 
00787 #ifdef __STLSOFT_CF_ASSERT_SUPPORT
00788 # ifdef __STLSOFT_CF_USE_cassert
00789   /* Using the standard assertion mechanism, located in <cassert> */
00790 #  include <cassert>
00791 #  define stlsoft_assert(ex)                assert(ex)
00792 # else
00793   /* Using either a custom or proprietary assertion mechanism, so must
00794    * provide the header include name
00795    */
00796 #  ifndef __STLSOFT_CF_ASSERT_INCLUDE_NAME
00797 #   error Must supply an assert include filename with custom or proprietary assertion mechanism
00798 #  else
00799 #   include __STLSOFT_CF_ASSERT_INCLUDE_NAME
00800 #  endif /* !__STLSOFT_CF_ASSERT_INCLUDE_NAME */
00801 # endif /* __STLSOFT_CF_USE_cassert */
00802 # ifndef stlsoft_assert
00803 #  error If your compiler discrimination file supports assertions, it must defined stlsoft_assert() (taking a single parameter)
00804 # endif /* !stlsoft_assert */
00805 #endif /* !__STLSOFT_CF_ASSERT_SUPPORT */
00806 
00811 #if defined(__STLSOFT_CF_ASSERT_SUPPORT)
00812 # if defined(__WATCOMC__)
00813 #  define stlsoft_message_assert(msg, ex)   stlsoft_assert(ex)
00814 # elif defined(__GNUC__) || \
00815        defined(__MWERKS__)
00816 #  define stlsoft_message_assert(msg, ex)   stlsoft_assert((msg && ex))
00817 # else
00818 #  define stlsoft_message_assert(msg, ex)   stlsoft_assert((msg, ex))
00819 # endif /* __WATCOMC__ */
00820 #else
00821 # define stlsoft_message_assert(msg, ex)
00822 #endif /* __STLSOFT_CF_ASSERT_SUPPORT */
00823 
00827 #if defined(__STLSOFT_CF_STATIC_ASSERT_SUPPORT)
00828 # if (  defined(__STLSOFT_COMPILER_IS_GCC) && \
00829         (   __GNUC__ < 3 || \
00830             (   __GNUC__ == 3 && \
00831                 __GNUC_MINOR__ < 4))) || \
00832      defined(__STLSOFT_COMPILER_IS_INTEL)
00833 #   define stlsoft_static_assert(ex)        do { typedef int ai[(ex) ? 1 : -1]; } while(0)
00834 #  else
00835 #   define stlsoft_static_assert(ex)        do { typedef int ai[(ex) ? 1 : 0]; } while(0)
00836 # endif /* compiler */
00837 #else
00838 # define stlsoft_static_assert(ex)          stlsoft_message_assert("Static assertion failed: ", (ex))
00839 #endif /* __STLSOFT_COMPILER_IS_DMC */
00840 
00841 /* 
00842  * Namespace
00843  *
00844  * The STLSoft uses namespaces by default, unless the _STLSOFT_NO_NAMESPACES
00845  * preprocessor symbol is defined, in which case all elements are placed within
00846  * the global namespace.
00847  *
00848  * The macro stlsoft_ns_qual() macro can be used to refer to elements in the
00849  * STLSoft libraries irrespective of whether they are in the stlsoft namespace
00850  * or in the global namespace.
00851  *
00852  * Some compilers do not support the standard library in the std namespace, so
00853  * the stlsoft_ns_qual_std() macro can be used to refer to elements in the
00854  * STLSoft libraries irrespective of whether they are in the std namespace or
00855  * in the global namespace.
00856  */
00857 
00858 /* No STLSoft namespaces means no stlsoft namespace */
00859 #ifdef _STLSOFT_NO_NAMESPACES
00860 # define _STLSOFT_NO_NAMESPACE
00861 #endif /* _STLSOFT_NO_NAMESPACES */
00862 
00863 #ifndef _STLSOFT_NO_NAMESPACE
00867 namespace stlsoft
00868 {
00869 #endif /* !_STLSOFT_NO_NAMESPACE */
00870 
00873 
00876 
00877 #ifndef _STLSOFT_NO_NAMESPACE
00878 # define stlsoft_ns_qual(x)          ::stlsoft::x
00879 # define stlsoft_ns_using(x)         using ::stlsoft::x;
00880 #else
00881 # define stlsoft_ns_qual(x)          x
00882 # define stlsoft_ns_using(x)
00883 #endif /* !_STLSOFT_NO_NAMESPACE */
00884 
00887 
00890 
00891 #ifdef __STLSOFT_CF_std_NAMESPACE
00892 # define stlsoft_ns_qual_std(x)      ::std::x
00893 # define stlsoft_ns_using_std(x)     using ::std::x;
00894 #else
00895 # define stlsoft_ns_qual_std(x)      x
00896 # define stlsoft_ns_using_std(x)
00897 #endif /* !__STLSOFT_CF_std_NAMESPACE */
00898 
00899 /* 
00900  * Typedefs
00901  *
00902  * The STLSoft uses a number of typedefs to aid in compiler-independence in the
00903  * libraries' main code.
00904  */
00905 
00906 /* Type definitions - precursors */
00907 
00908 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00909 
00910 /* ptrdiff_t
00911  */
00912 #ifndef _STLSOFT_NO_STD_INCLUDES
00913  typedef ptrdiff_t                  ss_ptrdiff_pr_t_;   // ptr diff
00914 #else
00915  typedef int                        ss_ptrdiff_pr_t_;   // ptr diff
00916 #endif /* !_STLSOFT_NO_STD_INCLUDES */
00917 
00918 /* size_t
00919  */
00920 #ifndef _STLSOFT_NO_STD_INCLUDES
00921  typedef size_t                     ss_size_pr_t_;      // size
00922 #else
00923  typedef unsigned int               ss_size_pr_t_;      // size
00924 #endif /* !_STLSOFT_NO_STD_INCLUDES */
00925 
00926 /* wchar_t
00927  *
00928  * wchar_t is either a built-in type, or is defined to unsigned 16-bit value
00929  */
00930 
00931 #ifdef __STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
00932  /* It's some kind of compiler native type. */
00933 # ifndef __STLSOFT_NATIVE_WCHAR_T
00934   /* either wchar_t itself */
00935   typedef wchar_t                  ss_char_w_pr_t_;    // Unicode char type
00936 # else
00937   /* or a compiler-specific type */
00938   typedef __STLSOFT_NATIVE_WCHAR_T ss_char_w_pr_t_;    // Unicode char type
00939 # endif /* !__STLSOFT_NATIVE_WCHAR_T */
00940 #elif defined(__STLSOFT_CF_TYPEDEF_WCHAR_T_SUPPORT)
00941   typedef wchar_t                  ss_char_w_pr_t_;    // Unicode char type
00942 #else
00943  /* It's some kind of library-defined type. */
00944 # ifndef _STLSOFT_NO_STD_INCLUDES
00945   typedef wchar_t                   ss_char_w_pr_t_;    // Unicode char type
00946 # else
00947   typedef unsigned short            ss_char_w_pr_t_;    // Unicode char type
00948 # endif /* __STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT */
00949 #endif /* !__STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT */
00950 
00951 /* 8-bit */
00952 #ifdef STLSOFT_CF_8BIT_INT_SUPPORT
00953 # ifdef STLSOFT_CF_8BIT_INT_IS_EXTENDED_TYPE
00954  typedef STLSOFT_CF_EXTENDED_INT8_T     ss_int8_pr_t_;
00955  typedef STLSOFT_CF_EXTENDED_SINT8_T    ss_sint8_pr_t_;
00956  typedef STLSOFT_CF_EXTENDED_UINT8_T    ss_uint8_pr_t_;
00957 # else /* ? STLSOFT_CF_8BIT_INT_IS_EXTENDED_TYPE */
00958  typedef STLSOFT_CF_STANDARD_INT8_T     ss_int8_pr_t_;
00959  typedef STLSOFT_CF_STANDARD_SINT8_T    ss_sint8_pr_t_;
00960  typedef STLSOFT_CF_STANDARD_UINT8_T    ss_uint8_pr_t_;
00961 # endif /* STLSOFT_CF_8BIT_INT_IS_EXTENDED_TYPE */
00962 #else
00963 # error STLSoft requires 8-bit integer support
00964 #endif /* STLSOFT_CF_8BIT_INT_SUPPORT */
00965 
00966 /* 16-bit */
00967 #ifdef STLSOFT_CF_16BIT_INT_SUPPORT
00968 # ifdef STLSOFT_CF_16BIT_INT_IS_EXTENDED_TYPE
00969  typedef STLSOFT_CF_EXTENDED_INT16_T    ss_int16_pr_t_;
00970  typedef STLSOFT_CF_EXTENDED_SINT16_T   ss_sint16_pr_t_;
00971  typedef STLSOFT_CF_EXTENDED_UINT16_T   ss_uint16_pr_t_;
00972 # else /* ? STLSOFT_CF_16BIT_INT_IS_EXTENDED_TYPE */
00973  typedef STLSOFT_CF_STANDARD_INT16_T    ss_int16_pr_t_;
00974  typedef STLSOFT_CF_STANDARD_SINT16_T   ss_sint16_pr_t_;
00975  typedef STLSOFT_CF_STANDARD_UINT16_T   ss_uint16_pr_t_;
00976 # endif /* STLSOFT_CF_16BIT_INT_IS_EXTENDED_TYPE */
00977 #else
00978 # error STLSoft requires 16-bit integer support
00979 #endif /* STLSOFT_CF_16BIT_INT_SUPPORT */
00980 
00981 /* 32-bit */
00982 #ifdef STLSOFT_CF_32BIT_INT_SUPPORT
00983 # ifdef STLSOFT_CF_32BIT_INT_IS_EXTENDED_TYPE
00984  typedef STLSOFT_CF_EXTENDED_INT32_T    ss_int32_pr_t_;
00985  typedef STLSOFT_CF_EXTENDED_SINT32_T   ss_sint32_pr_t_;
00986  typedef STLSOFT_CF_EXTENDED_UINT32_T   ss_uint32_pr_t_;
00987 # else /* ? STLSOFT_CF_32BIT_INT_IS_EXTENDED_TYPE */
00988  typedef STLSOFT_CF_STANDARD_INT32_T    ss_int32_pr_t_;
00989  typedef STLSOFT_CF_STANDARD_SINT32_T   ss_sint32_pr_t_;
00990  typedef STLSOFT_CF_STANDARD_UINT32_T   ss_uint32_pr_t_;
00991 # endif /* STLSOFT_CF_32BIT_INT_IS_EXTENDED_TYPE */
00992 #else
00993 # error STLSoft requires 32-bit integer support
00994 #endif /* STLSOFT_CF_32BIT_INT_SUPPORT */
00995 
00996 /* 64-bit */
00997 #ifdef STLSOFT_CF_64BIT_INT_SUPPORT
00998 # ifdef STLSOFT_CF_64BIT_INT_IS_EXTENDED_TYPE
00999  typedef STLSOFT_CF_EXTENDED_INT64_T    ss_int64_pr_t_;
01000  typedef STLSOFT_CF_EXTENDED_SINT64_T   ss_sint64_pr_t_;
01001  typedef STLSOFT_CF_EXTENDED_UINT64_T   ss_uint64_pr_t_;
01002 # else /* ? STLSOFT_CF_64BIT_INT_IS_EXTENDED_TYPE */
01003  typedef STLSOFT_CF_STANDARD_INT64_T    ss_int64_pr_t_;
01004  typedef STLSOFT_CF_STANDARD_SINT64_T   ss_sint64_pr_t_;
01005  typedef STLSOFT_CF_STANDARD_UINT64_T   ss_uint64_pr_t_;
01006 # endif /* STLSOFT_CF_64BIT_INT_IS_EXTENDED_TYPE */
01007 #endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
01008 
01009 /* bool */
01010 #ifdef __STLSOFT_CF_NATIVE_BOOL_SUPPORT
01011  typedef bool               ss_bool_pr_t_;
01012 #else
01013  typedef unsigned int       ss_bool_pr_t_;
01014 #endif /* __STLSOFT_CF_NATIVE_BOOL_SUPPORT */
01015 
01016 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
01017 
01018 /* Type definitions - proper */
01019 
01020 typedef char                ss_char_a_t;        
01021 typedef ss_char_w_pr_t_     ss_char_w_t;        
01022 typedef ss_int8_pr_t_       ss_int8_t;          
01023 typedef ss_sint8_pr_t_      ss_sint8_t;         
01024 typedef ss_uint8_pr_t_      ss_uint8_t;         
01025 typedef ss_int16_pr_t_      ss_int16_t;         
01026 typedef ss_sint16_pr_t_     ss_sint16_t;        
01027 typedef ss_uint16_pr_t_     ss_uint16_t;        
01028 typedef ss_int32_pr_t_      ss_int32_t;         
01029 typedef ss_sint32_pr_t_     ss_sint32_t;        
01030 typedef ss_uint32_pr_t_     ss_uint32_t;        
01031 #ifdef STLSOFT_CF_64BIT_INT_SUPPORT
01032  typedef ss_int64_pr_t_     ss_int64_t;         
01033  typedef ss_sint64_pr_t_    ss_sint64_t;        
01034  typedef ss_uint64_pr_t_    ss_uint64_t;        
01035 #endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
01036 typedef short               ss_short_t;         
01037 typedef int                 ss_int_t;           
01038 typedef signed int          ss_sint_t;          
01039 typedef unsigned int        ss_uint_t;          
01040 typedef long                ss_long_t;          
01041 typedef ss_uint8_t          ss_byte_t;          
01042 typedef ss_bool_pr_t_       ss_bool_t;          
01043 typedef ss_size_pr_t_       ss_size_t;          
01044 typedef ss_ptrdiff_pr_t_    ss_ptrdiff_t;       
01045 typedef long                ss_streampos_t;     
01046 typedef long                ss_streamoff_t;     
01047 
01048 #ifndef _STLSOFT_NO_NAMESPACE
01049 typedef ss_char_a_t         char_a_t;           
01050 typedef ss_char_w_t         char_w_t;           
01051 typedef ss_int8_t           int8_t;             
01052 typedef ss_sint8_t          sint8_t;            
01053 typedef ss_uint8_t          uint8_t;            
01054 typedef ss_int16_t          int16_t;            
01055 typedef ss_sint16_t         sint16_t;           
01056 typedef ss_uint16_t         uint16_t;           
01057 typedef ss_int32_t          int32_t;            
01058 typedef ss_sint32_t         sint32_t;           
01059 typedef ss_uint32_t         uint32_t;           
01060 # ifdef STLSOFT_CF_64BIT_INT_SUPPORT
01061 typedef ss_int64_t          int64_t;            
01062 typedef ss_sint64_t         sint64_t;           
01063 typedef ss_uint64_t         uint64_t;           
01064 # endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
01065 typedef ss_short_t          short_t;            
01066 typedef ss_int_t            int_t;              
01067 typedef ss_sint_t           sint_t;             
01068 typedef ss_uint_t           uint_t;             
01069 typedef ss_long_t           long_t;             
01070 typedef ss_byte_t           byte_t;             
01071 typedef ss_bool_t           bool_t;             
01072 # if !defined(__STLSOFT_COMPILER_IS_DMC)
01073 typedef ss_size_t           size_t;             
01074 typedef ss_ptrdiff_t        ptrdiff_t;          
01075 typedef ss_streampos_t      streampos_t;        
01076 typedef ss_streamoff_t      streamoff_t;        
01077 # endif /* compiler */
01078 #endif /* !_STLSOFT_NO_NAMESPACE */
01079 
01080 
01081 #if 0
01082 template <ss_size_t N>
01083 struct uintp_traits;
01084 
01085 STLSOFT_GEN_TRAIT_SPECIALISATION
01086 struct uintp_traits<1>
01087 {
01088     typedef uint8_t     unsigned_type;
01089 }
01090 
01091 typedef size_traits<sizeof(void*)>::signed_type     sintp_t;
01092 typedef size_traits<sizeof(void*)>::unsigned_type   uintp_t;
01093 
01094 #endif /* 0 */
01095 
01096 
01097 
01098 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
01099 # ifdef __cplusplus
01100 struct stlsoft_size_checker
01101 {
01102 #  ifdef __STLSOFT_COMPILER_IS_GCC
01103 protected: // GCC is too "helpful" in this case, so must declare as protected
01104 #  else
01105 private:
01106 #  endif /* __STLSOFT_COMPILER_IS_GCC */
01107     stlsoft_size_checker();
01108     ~stlsoft_size_checker()
01109     {
01110         // Char types
01111         stlsoft_static_assert(sizeof(ss_char_a_t) >= 1);
01112         stlsoft_static_assert(sizeof(ss_char_w_t) >= 2);
01113         // 8-bit types
01114         stlsoft_static_assert(sizeof(ss_int8_t)   == 1);
01115         stlsoft_static_assert(sizeof(ss_sint8_t)  == sizeof(ss_int8_t));
01116         stlsoft_static_assert(sizeof(ss_uint8_t)  == sizeof(ss_int8_t));
01117         // 16-bit types
01118         stlsoft_static_assert(sizeof(ss_int16_t)  == 2);
01119         stlsoft_static_assert(sizeof(ss_sint16_t) == sizeof(ss_int16_t));
01120         stlsoft_static_assert(sizeof(ss_uint16_t) == sizeof(ss_int16_t));
01121         // 32-bit types
01122         stlsoft_static_assert(sizeof(ss_int32_t)  == 4);
01123         stlsoft_static_assert(sizeof(ss_sint32_t) == sizeof(ss_int32_t));
01124         stlsoft_static_assert(sizeof(ss_uint32_t) == sizeof(ss_int32_t));
01125         // 64-bit types
01126 #  ifdef STLSOFT_CF_64BIT_INT_SUPPORT
01127         stlsoft_static_assert(sizeof(ss_int64_t)  == 8);
01128         stlsoft_static_assert(sizeof(ss_sint64_t) == sizeof(ss_int64_t));
01129         stlsoft_static_assert(sizeof(ss_uint64_t) == sizeof(ss_int64_t));
01130 #  endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
01131         // Integer types
01132         stlsoft_static_assert(sizeof(ss_int_t)    >= 1);
01133         stlsoft_static_assert(sizeof(ss_sint_t)   == sizeof(ss_int_t));
01134         stlsoft_static_assert(sizeof(ss_uint_t)   == sizeof(ss_int_t));
01135         stlsoft_static_assert(sizeof(ss_long_t)   >= sizeof(ss_int_t));
01136         // byte type
01137         stlsoft_static_assert(sizeof(ss_byte_t)   == 1);
01138         // Bool type
01139         stlsoft_static_assert(sizeof(ss_bool_t)   >= 1);
01140         // Other types
01141         stlsoft_static_assert(sizeof(ss_size_t)   >= 1);
01142         stlsoft_static_assert(sizeof(ss_ptrdiff_t) >= 1);
01143         stlsoft_static_assert(sizeof(ss_streampos_t) >= 1);
01144         stlsoft_static_assert(sizeof(ss_streamoff_t) >= 1);
01145     }
01146 };
01147 # endif /* __cplusplus */
01148 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
01149 
01150 /* 
01151  * Keywords
01152  *
01153  * The STLSoft uses a number of preprocessor symbols to aid in compiler
01154  * compatibility in the libraries' code.
01155  *
01156  * ss_explicit_k            -   explicit, or nothing
01157  * ss_mutable_k             -   mutable, or nothing
01158  * ss_typename_type_k       -   typename, or nothing (used within template
01159  *                              definitions for declaring types derived from
01160  *                              externally derived types)
01161  * ss_typename_param_k      -   typename or class (used for template parameters)
01162  * ss_typename_type_def_k   -   typename qualifier in template default parameters
01163  * ss_typename_type_mil_k   -   typename qualifier in constructor initialiser lists
01164  */
01165 
01169 #ifdef __STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
01170 # define ss_explicit_k              explicit
01171 #else
01172 # define ss_explicit_k
01173 #endif /* __STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT */
01174 
01178 #ifdef __STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
01179 # define ss_mutable_k               mutable
01180 #else
01181 # define ss_mutable_k
01182 #endif /* __STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT */
01183 
01187 #ifdef __STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
01188 # define ss_typename_param_k        typename
01189 #else
01190 # define ss_typename_param_k        class
01191 #endif /* __STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT */
01192 
01196 #ifdef __STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
01197 # define ss_typename_type_k         typename
01198 #else
01199 # define ss_typename_type_k
01200 #endif /* __STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT */
01201 
01205 #ifdef __STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
01206 # define ss_typename_type_def_k     typename
01207 #else
01208 # define ss_typename_type_def_k
01209 #endif /* __STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT */
01210 
01214 #ifdef __STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT
01215 # define ss_typename_type_mil_k     typename
01216 #else
01217 # define ss_typename_type_mil_k
01218 #endif /* __STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT */
01219 
01220 
01221 
01222 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
01223 /* 
01224  * Values
01225  *
01226  * Since the boolean type may not be supported natively on all compilers, the
01227  * values of true and false may also not be provided. Hence the values of
01228  * ss_true_v and ss_false_v are defined, and are used in all code.
01229  */
01230 
01231 #ifdef __STLSOFT_CF_NATIVE_BOOL_SUPPORT
01232 # define ss_true_v       (true)
01233 # define ss_false_v      (false)
01234 #else
01235 # define ss_true_v       (1)
01236 # define ss_false_v      (0)
01237 #endif /* __STLSOFT_CF_NATIVE_BOOL_SUPPORT */
01238 
01239 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
01240 /* 
01241  * Code modification macros
01242  */
01243 
01249 
01250 /* Exception signatures. */
01251 #if !defined(STLSOFT_NO_USE_EXCEPTION_SPECIFICATIONS) && \
01252     !defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION) && \
01253     (   defined(STLSOFT_USE_EXCEPTION_SPECIFICATIONS) || \
01254         defined(__STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT))
01255 # ifndef STLSOFT_USE_EXCEPTION_SPECIFICATIONS
01256 #  define STLSOFT_USE_EXCEPTION_SPECIFICATIONS
01257 # endif /* !STLSOFT_USE_EXCEPTION_SPECIFICATIONS */
01258 # define stlsoft_throw_0()                                  throw ()
01259 # define stlsoft_throw_1(x1)                                throw (x1)
01260 # define stlsoft_throw_2(x1, x2)                            throw (x1, x2)
01261 # define stlsoft_throw_3(x1, x2, x3)                        throw (x1, x2, x3)
01262 # define stlsoft_throw_4(x1, x2, x3, x4)                    throw (x1, x2, x3, x4)
01263 # define stlsoft_throw_5(x1, x2, x3, x4, x5)                throw (x1, x2, x3, x4, x5)
01264 # define stlsoft_throw_6(x1, x2, x3, x4, x5, x6)            throw (x1, x2, x3, x4, x5, x6)
01265 # define stlsoft_throw_7(x1, x2, x3, x4, x5, x6, x7)        throw (x1, x2, x3, x4, x5, x6, x7)
01266 # define stlsoft_throw_8(x1, x2, x3, x4, x5, x6, x7, x8)    throw (x1, x2, x3, x4, x5, x6, x7, x8)
01267 #else
01268 # ifdef STLSOFT_USE_EXCEPTION_SPECIFICATIONS
01269 #  undef STLSOFT_USE_EXCEPTION_SPECIFICATIONS
01270 # endif /* STLSOFT_USE_EXCEPTION_SPECIFICATIONS */
01271 # define stlsoft_throw_0()
01272 # define stlsoft_throw_1(x1)
01273 # define stlsoft_throw_2(x1, x2)
01274 # define stlsoft_throw_3(x1, x2, x3)
01275 # define stlsoft_throw_4(x1, x2, x3, x4)
01276 # define stlsoft_throw_5(x1, x2, x3, x4, x5)
01277 # define stlsoft_throw_6(x1, x2, x3, x4, x5, x6)
01278 # define stlsoft_throw_7(x1, x2, x3, x4, x5, x6, x7)
01279 # define stlsoft_throw_8(x1, x2, x3, x4, x5, x6, x7, x8)
01280 #endif /* __STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT && !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
01281 
01314 
01315 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
01316 # define stlsoft_num_elements_(ar)                      (sizeof(ar) / sizeof(0[(ar)]))
01317 
01318 # if defined(__cplusplus) && \
01319      defined(__STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT)
01320 #  if 0/* defined(__STLSOFT_COMPILER_IS_GCC) */
01321 #   pragma pack(push, 1)
01322 template <int N>
01323 struct ss_array_size_struct
01324 {
01325     ss_byte_t c[N];
01326 };
01327 #   pragma pack(pop)
01328 
01329 template <class T, int N>
01330 ss_array_size_struct<N> ss_static_array_size(T (&)[N]);
01331 
01332 #   define stlsoft_num_elements(ar)                     sizeof(stlsoft_ns_qual(ss_static_array_size)(ar))
01333 #  else /* ? 0 */
01334 template <int N>
01335 struct ss_array_size_struct
01336 {
01337     ss_byte_t c[N];
01338 };
01339 
01340 template <class T, int N>
01341 ss_array_size_struct<N> ss_static_array_size(T (&)[N]);
01342 
01343 #if defined(__STLSOFT_COMPILER_IS_VECTORC)
01344 template <class T, int N>
01345 ss_array_size_struct<N> ss_static_array_size(T const (&)[N]);
01346 #endif /* __STLSOFT_COMPILER_IS_VECTORC */
01347 
01348 
01349 #   define stlsoft_num_elements(ar)                     sizeof(stlsoft_ns_qual(ss_static_array_size)(ar).c)
01350 #  endif /* 0 */
01351 # else
01352 #  define stlsoft_num_elements(ar)                      stlsoft_num_elements_(ar)
01353 # endif /* __cplusplus && __STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT */
01354 #else
01355 # define stlsoft_num_elements(ar)
01356 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
01357 
01361 
01362 #if defined(__STLSOFT_COMPILER_IS_GCC) && \
01363     __GNUC__ >= 3
01364 # define stlsoft_raw_offsetof(s, m)                     (reinterpret_cast<stlsoft_ns_qual(ss_size_t)>(&reinterpret_cast<s *>(1)->m) - 1)
01365 #else
01366 # ifndef _STLSOFT_NO_STD_INCLUDES
01367 #  define stlsoft_raw_offsetof(s, m)                    offsetof(s, m)
01368 # else
01369 #  define stlsoft_raw_offsetof(s, m)                    reinterpret_cast<stlsoft_ns_qual(ss_size_t)>(&static_cast<s *>(0)->m)
01370 # endif /* !_STLSOFT_NO_STD_INCLUDES */
01371 #endif /* __GNUC__ >= 3 */
01372 
01373 
01374 /* destroy function */
01375 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
01376 template <ss_typename_param_k T>
01377 inline void stlsoft_destroy_instance_fn(T *p)
01378 {
01379     p->~T();
01380 
01381     /* SSCB: Borland C++ and Visual C++ remove the dtor for basic
01382      * structs, and then warn that p is unused. This reference
01383      * suppresses that warning.
01384      */
01385     ((void)p);
01386 }
01387 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
01388 
01392 #if defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION) || \
01393     defined(__STLSOFT_COMPILER_IS_DMC)
01394 # define stlsoft_destroy_instance(t, _type, p)          do { (p)->~t(); } while(0)
01395 #else
01396 # define stlsoft_destroy_instance(t, _type, p)          stlsoft_ns_qual(stlsoft_destroy_instance_fn)((p))
01397 #endif /* __STLSOFT_COMPILER_IS_DMC */
01398 
01415 
01416 #define stlsoft_gen_opaque(type)                        typedef struct __stlsoft_htype##type{ int i;} const *type;
01417 
01448 
01449 #if defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION) || \
01450     defined(__STLSOFT_COMPILER_IS_BORLAND) || \
01451     defined(__STLSOFT_COMPILER_IS_COMO) || \
01452     defined(__STLSOFT_COMPILER_IS_DMC) || \
01453     (   defined(__STLSOFT_COMPILER_IS_GCC) && \
01454         __GNUC__ < 3) || \
01455     defined(__STLSOFT_COMPILER_IS_INTEL) || \
01456     defined(__STLSOFT_COMPILER_IS_MSVC) || \
01457     defined(__STLSOFT_COMPILER_IS_VECTORC) || \
01458     defined(__STLSOFT_COMPILER_IS_WATCOM)
01459 # define    STLSOFT_DECLARE_TEMPLATE_PARAM_AS_FRIEND(T)     friend T
01460 #elif defined(__STLSOFT_COMPILER_IS_MWERKS)
01461 # define    STLSOFT_DECLARE_TEMPLATE_PARAM_AS_FRIEND(T)     friend class T
01462 #elif defined(__STLSOFT_COMPILER_IS_GCC) && \
01463       __GNUC__ >= 3
01464 
01465 # if __GNUC_MINOR__ > 2
01466 
01467   // This version of the technique for GCC 3.3+ was suggested by Lars Rune Nøstdal,
01468   // from Norway. Many thanks, Lars!
01469 
01470 #  define    STLSOFT_DECLARE_TEMPLATE_PARAM_AS_FRIEND(T)    \
01471                                                             \
01472     struct friend_maker                                     \
01473     {                                                       \
01474         typedef T T2;                                       \
01475     };                                                      \
01476                                                             \
01477     friend class friend_maker::T2
01478 
01479 # else /* ? __GNUC_MINOR__ */
01480 
01481 #  define    STLSOFT_DECLARE_TEMPLATE_PARAM_AS_FRIEND(T)    \
01482                                                             \
01483     struct friend_maker                                     \
01484     {                                                       \
01485         typedef T T2;                                       \
01486     };                                                      \
01487                                                             \
01488     typedef typename friend_maker::T2 friend_type;          \
01489                                                             \
01490     friend friend_type
01491 
01492 # endif /* __GNUC_MINOR__ */
01493 
01494 #else
01495 # error Compiler not discriminated
01496 #endif /* compiler */
01497 
01498 
01504 #define STLSOFT_GEN_TRAIT_SPECIALISATION(TR, T, V)  \
01505                                                     \
01506     STLSOFT_TEMPLATE_SPECIALISATION                 \
01507     struct TR<T>                                    \
01508     {                                               \
01509         enum { value = V };                         \
01510     };
01511 
01512 
01518 #if defined(__STLSOFT_COMPILER_IS_COMO) || \
01519     defined(__STLSOFT_COMPILER_IS_DMC) || \
01520     defined(__STLSOFT_COMPILER_IS_GCC) || \
01521     defined(__STLSOFT_COMPILER_IS_INTEL)
01522 template<ss_typename_param_k T>
01523 inline void suppress_unused_func(T const volatile &)
01524 {}
01525 # define STLSOFT_SUPPRESS_UNUSED(x)     stlsoft_ns_qual(suppress_unused_func)(x)
01526 #else /* ? __STLSOFT_COMPILER_IS_INTEL */
01527 # define STLSOFT_SUPPRESS_UNUSED(x)     ((void)x)
01528 #endif /* __STLSOFT_COMPILER_IS_INTEL */
01529 
01530 
01531 
01533 
01538 
01544 template <ss_typename_param_k T>
01545 inline void const *ptr_byte_offset(T const p, ss_ptrdiff_t n)
01546 {
01547     return static_cast<void const *>(static_cast<ss_byte_t const *>(static_cast<void const *>(p)) + n);
01548 }
01549 
01555 template <ss_typename_param_k T>
01556 inline T const *ptr_offset(T const *p, ss_ptrdiff_t n)
01557 {
01558     return p + n;
01559 }
01560 
01562 template <ss_typename_param_k T1, ss_typename_param_k T2>
01563 inline ss_ptrdiff_t ptr_byte_diff(T1 const *p1, T2 const *p2)
01564 {
01565     return static_cast<ss_byte_t const *>(static_cast<void const *>(p1)) - static_cast<ss_byte_t const *>(static_cast<void const *>(p2));
01566 }
01567 
01569 template <ss_typename_param_k T1, ss_typename_param_k T2>
01570 inline ss_ptrdiff_t ptr_diff(T1 const *p1, T2 const *p2)
01571 {
01572     return p1 - p2;
01573 }
01574 
01576 
01578 template <ss_typename_param_k T>
01579 inline T &remove_const(T const &t)
01580 {
01581     return const_cast<T &>(t);
01582 }
01583 
01584 /* Mutable support */
01585 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
01586 template <ss_typename_param_k T>
01587 #ifdef __STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
01588 inline T &mutable_access(T &t)
01589 #else
01590 inline T &mutable_access(T const &t)
01591 #endif /* __STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT */
01592 {
01593 #ifdef __STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
01594     return t;
01595 #else
01596     return const_cast<T &>(t);
01597 #endif /* __STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT */
01598 }
01599 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
01600 
01601 /* Move constructor support */
01602 #ifdef __STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT
01603 # define stlsoft_define_move_rhs_type(t)            t &
01604 #else
01605 # define stlsoft_define_move_rhs_type(t)            t const &
01606 #endif /* __STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */
01607 
01608 template <ss_typename_param_k T>
01609 inline T &move_lhs_from_rhs(stlsoft_define_move_rhs_type(T) t)
01610 {
01611 #ifdef __STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT
01612     return t;
01613 #else
01614     return const_cast<T &>(t);
01615 #endif /* __STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */
01616 }
01617 
01618 /* 
01619  * Memory
01620  */
01621 
01622 // function operator new
01623 //
01624 // When namespaces are being used, stlsoft provides its own placement new,
01625 // otherwise it includes <new> in order to access the global version.
01626 
01627 #ifdef _STLSOFT_NO_NAMESPACE
01628 # if defined(__STLSOFT_COMPILER_IS_BORLAND) && \
01629       __BORLANDC__ < 0x0550
01630 #  include <new.h>
01631 # else
01632 #  include <new>
01633 # endif /* __STLSOFT_COMPILER_IS_BORLAND && __BORLANDC__ < 0x0550 */
01634 #else
01635 # if ( defined(__STLSOFT_COMPILER_IS_DMC) && \
01636        __DMC__ < 0x0833) || \
01637      ( defined(__STLSOFT_COMPILER_IS_MSVC) && \
01638        _MSC_VER < 1300)
01639 inline void *operator new(ss_size_t /* si */, void *pv)
01640 {
01641     return pv;
01642 }
01643 # endif /* compiler */
01644 #endif /* !_STLSOFT_NO_NAMESPACE */
01645 
01646 /* 
01647 
01648 #ifndef _STLSOFT_NO_NAMESPACE
01649 } // namespace stlsoft
01650 #endif /* !_STLSOFT_NO_NAMESPACE */
01651 
01652 /* 
01653  * Unit-testing
01654  */
01655 
01656 #ifdef STLSOFT_UNITTEST
01657 # ifndef STLSOFT_INCL_H_STLSOFT_UNITTEST
01658 #  include "stlsoft_unittest.h"
01659 # endif /* !STLSOFT_INCL_H_STLSOFT_UNITTEST */
01660 #endif /* STLSOFT_UNITTEST */
01661 
01662 /* 
01663 
01664 #endif /* !STLSOFT_INCL_H_STLSOFT */
01665 
01666 /* 

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004