summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/stl/stl_construct.h
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-10-16 03:52:48 +0000
committerobrien <obrien@FreeBSD.org>1999-10-16 03:52:48 +0000
commitb721bc1aede3b3211302d103a1de1019c732ce74 (patch)
tree0373fc465a78f12f63d0f0e1487af637156b8a58 /contrib/libstdc++/stl/stl_construct.h
parent9f01c491d0571ee2f91980be244eaeef54bef145 (diff)
downloadFreeBSD-src-b721bc1aede3b3211302d103a1de1019c732ce74.zip
FreeBSD-src-b721bc1aede3b3211302d103a1de1019c732ce74.tar.gz
Virgin import of GCC 2.95.1's libstdc++
Diffstat (limited to 'contrib/libstdc++/stl/stl_construct.h')
-rw-r--r--contrib/libstdc++/stl/stl_construct.h50
1 files changed, 31 insertions, 19 deletions
diff --git a/contrib/libstdc++/stl/stl_construct.h b/contrib/libstdc++/stl/stl_construct.h
index 4687635..761784d 100644
--- a/contrib/libstdc++/stl/stl_construct.h
+++ b/contrib/libstdc++/stl/stl_construct.h
@@ -35,35 +35,47 @@
__STL_BEGIN_NAMESPACE
-template <class T>
-inline void destroy(T* pointer) {
- pointer->~T();
+// construct and destroy. These functions are not part of the C++ standard,
+// and are provided for backward compatibility with the HP STL.
+
+template <class _Tp>
+inline void destroy(_Tp* __pointer) {
+ __pointer->~_Tp();
+}
+
+template <class _T1, class _T2>
+inline void construct(_T1* __p, const _T2& __value) {
+ new (__p) _T1(__value);
}
-template <class T1, class T2>
-inline void construct(T1* p, const T2& value) {
- new (p) T1(value);
+template <class _T1>
+inline void construct(_T1* __p) {
+ new (__p) _T1();
}
-template <class ForwardIterator>
+template <class _ForwardIterator>
inline void
-__destroy_aux(ForwardIterator first, ForwardIterator last, __false_type) {
- for ( ; first < last; ++first)
- destroy(&*first);
+__destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type)
+{
+ for ( ; __first != __last; ++__first)
+ destroy(&*__first);
}
-template <class ForwardIterator>
-inline void __destroy_aux(ForwardIterator, ForwardIterator, __true_type) {}
+template <class _ForwardIterator>
+inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) {}
-template <class ForwardIterator, class T>
-inline void __destroy(ForwardIterator first, ForwardIterator last, T*) {
- typedef typename __type_traits<T>::has_trivial_destructor trivial_destructor;
- __destroy_aux(first, last, trivial_destructor());
+template <class _ForwardIterator, class _Tp>
+inline void
+__destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
+{
+ typedef typename __type_traits<_Tp>::has_trivial_destructor
+ _Trivial_destructor;
+ __destroy_aux(__first, __last, _Trivial_destructor());
}
-template <class ForwardIterator>
-inline void destroy(ForwardIterator first, ForwardIterator last) {
- __destroy(first, last, value_type(first));
+template <class _ForwardIterator>
+inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
+ __destroy(__first, __last, __VALUE_TYPE(__first));
}
inline void destroy(char*, char*) {}
OpenPOWER on IntegriCloud