码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2020-01-20 09:18:07      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:with   g++   cell   tac   size   c++   use   ace   over   

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;

from 

Different exception specifier with g++ 6.2

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

标签:with   g++   cell   tac   size   c++   use   ace   over   

原文地址:https://www.cnblogs.com/fengtai/p/12216504.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!