// xmemory internal header (from <memory>)
#ifndef _XMEMORY_
#define _XMEMORY_

#pragma info(none)
#ifndef __CHKHDR__
#  pragma report(level, E)
#endif
#pragma info(restore)

#if __IBMCPP__ < 400
#error This file to be used only with IBM VisualAge C++ v4 and later compilers.
#endif /* __IBMCPP__ */

#pragma namemangling(ansi)

   /********************************************************************/
   /*  <xmemory> header file                                           */
   /*                                                                  */
   /*  VisualAge C++, Version 4.0                                      */
   /*    Licensed Material - Property of IBM                           */
   /*                                                                  */
   /*  5801-AAR and Other Materials                                    */
   /*                                                                  */
   /*  (c) Copyright IBM Corp 1991, 1998. All rights reserved.         */
   /*                                                                  */
   /*                                                                  */
   /*  Licensed Materials.                                             */
   /*                                                                  */
   /*  Dinkum C++ Library                                              */
   /*  Copyright (c) 1998.  Licensed to IBM Corp. and its suppliers.   */
   /*                                                                  */
   /********************************************************************/

#include <cstdlib>
#include <new>
#include <xutility>
#ifndef _FARQ	/* specify standard memory model */
 #define _FARQ
 #define _PDFT	ptrdiff_t
 #define _SIZT	size_t
#endif
 #define _CPOINTER_X(T, A)		\
	typename A::template rebind<T>::other::const_pointer
 #define _CREFERENCE_X(T, A)	\
	typename A::template rebind<T>::other::const_reference
 #define _POINTER_X(T, A)	\
	typename A::template rebind<T>::other::pointer
 #define _REFERENCE_X(T, A)	\
	typename A::template rebind<T>::other::reference
_STD_BEGIN
		// TEMPLATE FUNCTION _Allocate
template<class _Ty> inline
	_Ty _FARQ *_Allocate(_SIZT _N, _Ty _FARQ *)
	{return ((_Ty _FARQ *)operator new(_N * sizeof (_Ty))); }
		// TEMPLATE FUNCTION _Construct
template<class _T1, class _T2> inline
	void _Construct(_T1 _FARQ *_P, const _T2& _V)
	{new ((void _FARQ *)_P) _T1(_V); }
		// TEMPLATE FUNCTION _Destroy
template<class _Ty> inline
	void _Destroy(_Ty _FARQ *_P)
	{_DESTRUCTOR(_Ty, _P); }
template<> inline void _Destroy(char _FARQ *_P)
	{}
template<> inline void _Destroy(wchar_t _FARQ *_P)
	{}
		// TEMPLATE CLASS allocator
template<class _Ty>
	class allocator {
public:
	typedef _SIZT size_type;
	typedef _PDFT difference_type;
	typedef _Ty _FARQ *pointer;
	typedef const _Ty _FARQ *const_pointer;
	typedef _Ty _FARQ& reference;
	typedef const _Ty _FARQ& const_reference;
	typedef _Ty value_type;
	pointer address(reference _X) const
		{return (&_X); }
	const_pointer address(const_reference _X) const
		{return (&_X); }
	allocator()
		{}
	allocator(const allocator<_Ty>&)
		{}
	template<class _U>
		allocator(const allocator<_U>&)
		{}
	template<class _U>
		allocator<_Ty>& operator=(const allocator<_U>&)
		{return (*this); }
	template<class _U>
		struct rebind {
			typedef allocator<_U> other;
		};
	template<class _U>
		pointer allocate(size_type _N, const _U *)
		{return (_Allocate(_N, (pointer)0)); }
	pointer allocate(size_type _N)
		{return (_Allocate(_N, (pointer)0)); }
	void deallocate(pointer _P, size_type)
		{operator delete(_P); }
	void construct(pointer _P, const _Ty& _V)
		{_Construct(_P, _V); }
	void destroy(pointer _P)
		{_Destroy(_P); }
	_SIZT max_size() const
		{_SIZT _N = (_SIZT)(-1) / sizeof (_Ty);
		return (0 < _N ? _N : 1); }
	};
template<class _Ty, class _U> inline
	bool operator==(const allocator<_Ty>&, const allocator<_U>&)
	{return (true); }
template<class _Ty, class _U> inline
	bool operator!=(const allocator<_Ty>&, const allocator<_U>&)
	{return (false); }
		// CLASS allocator<void>
template<> class allocator<void> {
public:
	typedef void _Ty;
	typedef _Ty _FARQ *pointer;
	typedef const _Ty _FARQ *const_pointer;
	typedef _Ty value_type;
	allocator(const allocator<_Ty>&)
		{}
	template<class _U>
		allocator(const allocator<_U>&)
		{}
	template<class _U>
		allocator<_Ty>& operator=(const allocator<_U>&)
		{return (*this); }
	template<class _U>
		struct rebind {
			typedef allocator<_U> other;
		};
	};
_STD_END

#pragma namemangling()

#pragma info(none)
#ifndef __CHKHDR__
#  pragma report(pop)
#endif
#pragma info(restore)

#endif /* _XMEMORY_ */

/*
 * Copyright (c) 1995 by P.J. Plauger.  ALL RIGHTS RESERVED. 
 * Consult your license regarding permissions and restrictions.
 */

/*
 * This file is derived from software bearing the following
 * restrictions:
 *
 * Copyright (c) 1994
 * Hewlett-Packard Company
 *
 * 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.
 * Hewlett-Packard Company makes no representations about the
 * suitability of this software for any purpose. It is provided
 * "as is" without express or implied warranty.
V2.2:0081 */
