minix/external/bsd/libc++/dist/libcxx/test/language.support/support.dynamic/alloc.errors/set.new.handler/set_new_handler.pass.cpp

23 lines
546 B
C++
Raw Normal View History

//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// test set_new_handler
#include <new>
#include <cassert>
void f1() {}
void f2() {}
int main()
{
assert(std::set_new_handler(f1) == 0);
assert(std::set_new_handler(f2) == f1);
}