YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YBase Specified Pseudo-Keywords

YBase 指定的替代关键字。 更多...

宏定义

#define yalignof(_type)   std::alignment_of<_type>::value
 指定特定类型的对齐。
 
#define yconstexpr   const
 指定编译时常量表达式。
 
#define yconstfn   inline
 指定编译时常量函数。
 
#define ythrow   throw
 YSLib 动态异常规范:根据是否使用异常规范宏指定或忽略动态异常规范。
 
#define ynothrow   ynoexcept
 YSLib 无异常抛出保证:若支持 noexcept 关键字,指定特定的 noexcept 异常规范。
 
#define ynoexcept(...)
 YSLib 无异常抛出保证:指定特定的异常规范。
 
#define yconstraint   assert
 约束:接口语义。
 
#define yassume   assert
 假定:环境语义。
 
#define yoffsetof(_type, _member)
 带有静态类型检查的成员偏移计算。
 
#define yforward(_expr)   std::forward<decltype(_expr)>(_expr)
 根据参数类型使用 std::forward 传递对应参数。
 
#define yunseq   ystdex::unsequenced
 无序列依赖表达式组求值。
 

详细描述

YBase 指定的替代关键字。

自从
build 362

宏定义说明

#define yalignof (   _type)    std::alignment_of<_type>::value

指定特定类型的对齐。

注解
同 C++11 alignof 作用于类型时的语义。
自从
build 315
待办事项:
判断是否可使用 TR1 的情形。

在文件 ydef.h336 行定义.

#define yconstexpr   const

指定编译时常量表达式。

注解
同 C++11 constepxr 作用于编译时常量的语义。

在文件 ydef.h356 行定义.

参考自 YSLib::UI::ATrack::CheckArea(),InitializeEnviornment(),ShlExplorer::OnPaint(),ystdex::fixed_point< u16, 9 >::operator/=() , 以及 HexViewArea::Refresh().

#define yconstfn   inline

指定编译时常量函数。

注解
同 C++11 constepxr 作用于编译时常量函数的语义。

在文件 ydef.h357 行定义.

参考自 ystdex::ref_eq< _type >::operator()(),ystdex::delta_assignment< bool, _tScalar1, _tScalar2 >::operator()() , 以及 ystdex::delta_assignment< false, _tScalar1, _tScalar2 >::operator()().

#define yconstraint   assert

约束:接口语义。

注解
和普通断言相比强调接口契约。对于移植特定的平台实现时应予以特别注意。
自从
build 298

运行时检查的接口语义约束断言。不满足此断言的行为是接口明确地未定义的,行为不可预测。

在文件 ydef.h406 行定义.

参考自 CHRLib::FetchBiCharBE(),CHRLib::FetchBiCharLE(),ystdex::fexists(),MBCSToUCS2(),MBCToUC(),ystdex::ntctscmp(),ystdex::ntctsicmp(),ystdex::ntctslen(),strdup(),CHRLib::UCS2Mapper(),UCS2ToMBCS(),UCS4ToUCS2(),ucsdup(),UCToMBC(),platform::ufexists(),platform::ufopen() , 以及 platform::uopen().

#define yforward (   _expr)    std::forward<decltype(_expr)>(_expr)

根据参数类型使用 std::forward 传递对应参数。

自从
build 245

传递参数:按类型保持值类别(value catory) 和 const 修饰符。 当表达式类型为函数或函数引用类型时,结果为左值(lvalue) ,否则: 当且仅当左值引用类型时结果为左值(此时类型不变); 否则结果为对应的右值引用类型的消亡值(xvalue) 。

在文件 ydef.h569 行定义.

参考自 YSLib::GEvent< _tRet(_tParams...)>::Add(),YSLib::AddUnique(),ystdex::any::any(),ystdex::any_input_iterator< _type, _tDifference, _tPointer, _tReference >::any_input_iterator(),ystdex::assign(),ytest::timing::average(),YSLib::Drawing::BlitScan(),ystdex::call_once(),ystdex::call_once_init< _type, _tOnceFlag >::call_once_init(),YSLib::UI::CallEvent(),YSLib::CollectNodes(),YSLib::GEvent< _tRet(_tParams...)>::Contains(),ystdex::get_init(),YSLib::GEvent< _tRet(_tParams...)>::GEvent(),ystdex::call_once_init< _type, _tOnceFlag >::init(),ystdex::initializer_cast(),ystdex::make_array(),ystdex::make_transform(),YSLib::MakeNode(),ystdex::nifty_counter< _type, _tCount >::nifty_counter(),ytest::timing::once(),ytest::timing::once_c(),ystdex::container_inserter< _tContainer >::operator()(),YSLib::ExpandMemberFirst< _type, _tRet, _tPara, _tNew >::operator()(),YSLib::ExpandMemberFirstBinder< _type, _tRet, _tPara, _tNew >::operator()(),YSLib::GEvent< _tRet(_tParams...)>::operator()(),YSLib::GEventWrapper< GEvent< void(HPaintEvent::EventArgsType)>, UIEventArgs && >::operator()(),YSLib::GEvent< _tRet(_tParams...)>::operator+=(),YSLib::GEvent< _tRet(_tParams...)>::operator-=(),ystdex::pod_storage< non_aggregate_pod >::operator=(),YSLib::GEvent< _tRet(_tParams...)>::operator=(),ystdex::operator|(),YSLib::PackNodes(),ystdex::pod_storage< non_aggregate_pod >::pod_storage(),ScrDraw(),ystdex::seq_apply(),ystdex::seq_insert(),YSLib::StringifyToNode(),ytest::timing::total(),ytest::timing::total_c(),YSLib::UnpackToNode(),ystdex::unseq_apply() , 以及 ystdex::unsequenced().

#define ynoexcept (   ...)

YSLib 无异常抛出保证:指定特定的异常规范。

自从
build 319

在文件 ydef.h393 行定义.

#define ynothrow   ynoexcept

YSLib 无异常抛出保证:若支持 noexcept 关键字,指定特定的 noexcept 异常规范。

在文件 ydef.h379 行定义.

参考自 ystdex::details::have_common_nonempty_virtual_base< _type1, _type2 >::A::~A(),ystdex::details::have_nonempty_virtual_base< _type >::B::~B() , 以及 ystdex::details::have_nonempty_virtual_base< _type >::C::~C().

#define yoffsetof (   _type,
  _member 
)
值:
(decltype(sizeof(ystdex::offsetof_check<std::is_member_object_pointer< \
decltype(&_type::_member)>::value, ynoexcept(offsetof(_type, _member)), \
_type>))(offsetof(_type, _member)))

带有静态类型检查的成员偏移计算。

参见
ISO C++ 18.2/4 。
注解
某些 G++ 和 Clang++ 版本可使用 __builtin_offsetof 及 -Winvalid-offsetof , 但可移植性较差。
自从
build 325

在文件 ydef.h553 行定义.

#define ythrow   throw

YSLib 动态异常规范:根据是否使用异常规范宏指定或忽略动态异常规范。

注解
ythrow = "yielded throwing" 。

在文件 ydef.h368 行定义.

#define yunseq   ystdex::unsequenced

无序列依赖表达式组求值。

注解
由于实现限制,无法用于 void 类型表达式组。
使用一元形式 yunsequenced((_expr)) 的形式标记表达式组但不取消序列关系。
支持嵌套使用。
警告
非一元形式禁止用于产生对于同一对象的未序列化的(unsequenced) 副作用 的表达式,否则存在未定义行为。
非一元形式不适用于对顺序有依赖的表达式,包括所有可能抛出异常且对抛出顺序 敏感(例如 std::bad_cast 处理顺序不同可能造成内存泄露)的表达式。
自从
build 266

在文件 ydef.h595 行定义.