这是libev中来自ev.h的一段宏定义
#ifdef __cplusplus
# define EV_CPP(x) x
# if __cplusplus >= 201103L
# define EV_THROW noexcept
# else
# define EV_THROW throw ()
# endif
#else
# define EV_CPP(x)
# define EV_THROW
#endif
EV_CPP(extern "C" {)
some c funcitons
EV_CPP(})
c++中函数定义中的throw():
告诉编译器,进行代码优化,不添加异常处理代码
在c++ 11中,被关键字noexcept代替
网友评论