/*
        Copyright 06/08/00 Sun Microsystems, Inc. All Rights Reserved
*/
/* new

   @(#)new	1.6  06/08/00 13:21:33

   Declaration for ISO standard new and delete interface
*/
#if !defined(_NEW_HDR)
#define _NEW_HDR

#include <stddef.h>
#include <exception>

namespace std {

    class bad_alloc : public exception { 
      public:
	bad_alloc () throw() { }
	bad_alloc(const bad_alloc&) throw() { }
	bad_alloc& operator=(const bad_alloc&) throw() {return *this;}
	~bad_alloc () throw() { }
	const char* what() const throw();
    };
    struct nothrow_t {};
    extern const nothrow_t nothrow;
    typedef void (*new_handler) ();
    extern new_handler set_new_handler(new_handler new_p) throw();
} 

void* operator new(size_t) throw(std::bad_alloc);
void* operator new(size_t, const std::nothrow_t&) throw();
#pragma returns_new_memory (operator new)
void  operator delete(void*) throw();
void  operator delete(void*, const std::nothrow_t&) throw();
void* operator new[](size_t) throw(std::bad_alloc);
void* operator new[](size_t, const std::nothrow_t&) throw();
#pragma returns_new_memory (operator new[])
void  operator delete[](void*) throw();
void  operator delete[](void*, const std::nothrow_t&) throw();

inline void* operator new[] ( size_t, void* __ptr) throw() { return __ptr; }
inline void *operator new(size_t, void* __ptr) throw() { return __ptr; }
inline void operator delete  (void*, void*) throw() {}
inline void operator delete[](void*, void*) throw() {}

#endif	// _NEW_HDR
