// new standard header for Microsoft
#pragma once
#ifndef _NEW_
#define _NEW_
#include <exception>

#pragma pack(push,8)
#pragma warning(push,3)

  #pragma push_macro("new")
  #undef new

_STD_BEGIN
		// CLASS bad_alloc
class bad_alloc
	: public exception
	{	// base of all bad allocation exceptions
public:
	bad_alloc(const char *_Message = _MESG("bad allocation")) _THROW0()
		: exception(_Message)
		{	// construct from message string
		}

	virtual ~bad_alloc() _THROW0()
		{	// destroy the object
		}

 #if !_HAS_EXCEPTIONS
protected:
	virtual void _Doraise() const
		{	// perform class-specific exception handling
		_RAISE(*this);
		}
#endif  /* _HAS_EXCEPTIONS */

	};

		// SUPPORT TYPES
 #if !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS)
typedef void (__cdecl *new_handler)();	// handler for operator new failures
 #endif /* !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS) */

 #ifndef __NOTHROW_T_DEFINED
struct nothrow_t
	{	// placement new tag type to suppress exceptions
	};

extern const nothrow_t nothrow;	// constant for placement new tag
 #endif /* __NOTHROW_T_DEFINED */

		// FUNCTION AND OBJECT DECLARATIONS
_CRTIMP2 new_handler __cdecl set_new_handler(new_handler)
	_THROW0();	// establish alternate new handler
_STD_END

		// new AND delete DECLARATIONS (NB: NOT IN std)
void __cdecl operator delete(void *) _THROW0();
void *__cdecl operator new(size_t) _THROW1(std::bad_alloc);

 #ifndef __PLACEMENT_NEW_INLINE
  #define __PLACEMENT_NEW_INLINE
inline void *__cdecl operator new(size_t, void *_Where) _THROW0()
	{	// construct array with placement at _Where
	return (_Where);
	}

inline void __cdecl operator delete(void *, void *) _THROW0()
	{	// delete if placement new fails
	}
 #endif /* __PLACEMENT_NEW_INLINE */

 #ifndef __PLACEMENT_VEC_NEW_INLINE
  #define __PLACEMENT_VEC_NEW_INLINE
inline void *__cdecl operator new[](size_t, void *_Where) _THROW0()
	{	// construct array with placement at _Where
	return (_Where);
	}

inline void __cdecl operator delete[](void *, void *) _THROW0()
	{	// delete if placement array new fails
	}
 #endif /* __PLACEMENT_VEC_NEW_INLINE */

void __cdecl operator delete[](void *) _THROW0();	// delete allocated array

void *__cdecl operator new[](size_t)
	_THROW1(std::bad_alloc);	// allocate array or throw exception

 #ifndef __NOTHROW_T_DEFINED
  #define __NOTHROW_T_DEFINED
void *__cdecl operator new(size_t, const std::nothrow_t&)
	_THROW0();

void *__cdecl operator new[](size_t, const std::nothrow_t&)
	_THROW0();	// allocate array or return null pointer

void __cdecl operator delete(void *, const std::nothrow_t&)
	_THROW0();	// delete if nothrow new fails -- REPLACEABLE

void __cdecl operator delete[](void *, const std::nothrow_t&)
	_THROW0();	// delete if nothrow array new fails -- REPLACEABLE
 #endif /* __NOTHROW_T_DEFINED */



 #if !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS)
using std::new_handler;
 #endif /* !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS) */

  #pragma pop_macro("new")

#pragma warning(pop)
#pragma pack(pop)

#endif /* _NEW_ */

/*
 * Copyright (c) 1992-2002 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
 V3.13:0009 */
