* flow.c (find_basic_blocks): Handle cfg issues for rethrows and
[official-gcc.git] / libstdc++ / stl / stl_construct.h
blob46876353da6a11cf56491bdb7d07efa001d8f0be
1 /*
3 * Copyright (c) 1994
4 * Hewlett-Packard Company
6 * Permission to use, copy, modify, distribute and sell this software
7 * and its documentation for any purpose is hereby granted without fee,
8 * provided that the above copyright notice appear in all copies and
9 * that both that copyright notice and this permission notice appear
10 * in supporting documentation. Hewlett-Packard Company makes no
11 * representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
15 * Copyright (c) 1996,1997
16 * Silicon Graphics Computer Systems, Inc.
18 * Permission to use, copy, modify, distribute and sell this software
19 * and its documentation for any purpose is hereby granted without fee,
20 * provided that the above copyright notice appear in all copies and
21 * that both that copyright notice and this permission notice appear
22 * in supporting documentation. Silicon Graphics makes no
23 * representations about the suitability of this software for any
24 * purpose. It is provided "as is" without express or implied warranty.
27 /* NOTE: This is an internal header file, included by other STL headers.
28 * You should not attempt to use it directly.
31 #ifndef __SGI_STL_INTERNAL_CONSTRUCT_H
32 #define __SGI_STL_INTERNAL_CONSTRUCT_H
34 #include <new.h>
36 __STL_BEGIN_NAMESPACE
38 template <class T>
39 inline void destroy(T* pointer) {
40 pointer->~T();
43 template <class T1, class T2>
44 inline void construct(T1* p, const T2& value) {
45 new (p) T1(value);
48 template <class ForwardIterator>
49 inline void
50 __destroy_aux(ForwardIterator first, ForwardIterator last, __false_type) {
51 for ( ; first < last; ++first)
52 destroy(&*first);
55 template <class ForwardIterator>
56 inline void __destroy_aux(ForwardIterator, ForwardIterator, __true_type) {}
58 template <class ForwardIterator, class T>
59 inline void __destroy(ForwardIterator first, ForwardIterator last, T*) {
60 typedef typename __type_traits<T>::has_trivial_destructor trivial_destructor;
61 __destroy_aux(first, last, trivial_destructor());
64 template <class ForwardIterator>
65 inline void destroy(ForwardIterator first, ForwardIterator last) {
66 __destroy(first, last, value_type(first));
69 inline void destroy(char*, char*) {}
70 inline void destroy(wchar_t*, wchar_t*) {}
72 __STL_END_NAMESPACE
74 #endif /* __SGI_STL_INTERNAL_CONSTRUCT_H */
76 // Local Variables:
77 // mode:C++
78 // End: