declaration of 'void* operator new [](size_t)' has a different exception specifier

其实就是c++11和c++98的定义的坑

https://stackoverflow.com/questions/39188919/different-exception-specifier-with-g-6-2

Are you using C++11 or later?

The original operator new() declarations in C++98

throwing:   
void* operator new (std::size_t size) throw (std::bad_alloc);

nothrow:
void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) throw();

placement:
void* operator new (std::size_t size, void* ptr) throw();

Have been changed in C++11 to use noexcept keyword:

throwing:   
void* operator new (std::size_t size);

nothrow:    
void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;

placement:  
void* operator new (std::size_t size, void* ptr) noexcept;

转载于:https://my.oschina.net/u/4000302/blog/3095320

你可能感兴趣的:(declaration of 'void* operator new [](size_t)' has a different exception specifier)