- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Configs/TI_DSP_BIOS/stl/stl_construct.h

    00001 /*
    00002  *
    00003  * Copyright (c) 1994
    00004  * Hewlett-Packard Company
    00005  *
    00006  * Permission to use, copy, modify, distribute and sell this software
    00007  * and its documentation for any purpose is hereby granted without fee,
    00008  * provided that the above copyright notice appear in all copies and
    00009  * that both that copyright notice and this permission notice appear
    00010  * in supporting documentation.  Hewlett-Packard Company makes no
    00011  * representations about the suitability of this software for any
    00012  * purpose.  It is provided "as is" without express or implied warranty.
    00013  *
    00014  *
    00015  * Copyright (c) 1996,1997
    00016  * Silicon Graphics Computer Systems, Inc.
    00017  *
    00018  * Permission to use, copy, modify, distribute and sell this software
    00019  * and its documentation for any purpose is hereby granted without fee,
    00020  * provided that the above copyright notice appear in all copies and
    00021  * that both that copyright notice and this permission notice appear
    00022  * in supporting documentation.  Silicon Graphics makes no
    00023  * representations about the suitability of this software for any
    00024  * purpose.  It is provided "as is" without express or implied warranty.
    00025  */
    00026
    00027 /* NOTE: This is an internal header file, included by other STL headers.
    00028  *   You should not attempt to use it directly.
    00029  */
    00030
    00031 #ifndef __SGI_STL_INTERNAL_CONSTRUCT_H
    00032 #define __SGI_STL_INTERNAL_CONSTRUCT_H
    00033
    00034 #include <new.h>
    00035
    00036 __STL_BEGIN_NAMESPACE
    00037
    00038 // construct and destroy.  These functions are not part of the C++ standard,
    00039 // and are provided for backward compatibility with the HP STL.
    00040
    00041 template <class _Tp>
    00042 inline void destroy(_Tp* __pointer) {
    00043   __pointer->~_Tp();
    00044 }
    00045
    00046 template <class _T1, class _T2>
    00047 inline void construct(_T1* __p, const _T2& __value) {
    00048   new (__p) _T1(__value);
    00049 }
    00050
    00051 template <class _T1>
    00052 inline void construct(_T1* __p) {
    00053   new (__p) _T1();
    00054 }
    00055
    00056 template <class _ForwardIterator>
    00057 inline void
    00058 __destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type)
    00059 {
    00060   for ( ; __first != __last; ++__first)
    00061     destroy(&*__first);
    00062 }
    00063
    00064 template <class _ForwardIterator>
    00065 inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) {}
    00066
    00067 template <class _ForwardIterator, class _Tp>
    00068 inline void
    00069 __destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
    00070 {
    00071   typedef typename __type_traits<_Tp>::has_trivial_destructor
    00072           _Trivial_destructor;
    00073   __destroy_aux(__first, __last, _Trivial_destructor());
    00074 }
    00075
    00076 template <class _ForwardIterator>
    00077 inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
    00078   __destroy(__first, __last, __VALUE_TYPE(__first));
    00079 }
    00080
    00081 inline void destroy(char*, char*) {}
    00082 inline void destroy(wchar_t*, wchar_t*) {}
    00083
    00084 __STL_END_NAMESPACE
    00085
    00086 #endif /* __SGI_STL_INTERNAL_CONSTRUCT_H */
    00087
    00088 // Local Variables:
    00089 // mode:C++
    00090 // End: