YSTest  PreAlpha_b500_20140530
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(...)
 YSLib 动态异常规范:根据是否使用异常规范宏指定或忽略动态异常规范。 更多...
 
#define ynothrowv
 YSLib 无异常抛出保证验证:有条件地使用无异常抛出规范。 更多...
 
#define ynothrow   ythrow()
 YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。 更多...
 
#define ynoexcept(...)
 YSLib 无异常抛出保证:指定特定的异常规范。 更多...
 
#define ythread   static
 线程局部存储:若实现支持,指定为 thread_local更多...
 
#define yoffsetof(_type, _member)
 带有静态类型检查的成员偏移计算。 更多...
 
#define yforward(_expr)   std::forward<decltype(_expr)>(_expr)
 根据参数类型使用 std::forward 传递对应参数。 更多...
 
#define yunseq   ystdex::unsequenced
 无序列依赖表达式组求值。 更多...
 
#define yconstraint   assert
 约束:接口语义。 更多...
 
#define yassume   assert
 假定:环境语义。 更多...
 

详细描述

YBase 指定的替代关键字。

自从
build 362

宏定义说明

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

指定特定类型的对齐。

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

在文件 ydef.h442 行定义.

#define yassume   assert
#define yconstexpr   const

指定编译时常量表达式。

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

在文件 ydef.h462 行定义.

参考自 platform::ImplRet(), YSLib::InitializeEnviornment(), YReader::ShlExplorer::OnPaint() , 以及 YSLib::UI::HexViewArea::Refresh().

#define yconstfn   inline

指定编译时常量函数。

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

在文件 ydef.h463 行定义.

#define yconstraint   assert

约束:接口语义。

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

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

在文件 cassert.h47 行定义.

参考自 platform_ex::COMPtr< _iCOM >::As(), platform_ex::COMPtr< _iCOM >::Cast(), platform::KeyCategory::ClassifyKey(), platform_ex::COMException::COMException(), ystdex::concat(), platform_ex::COMPtr< _iCOM >::Copy(), platform_ex::COMPtr< _iCOM >::CopyTo(), platform_ex::COMPtr< _iCOM >::DefGetter(), CHRLib::FetchBiCharBE(), CHRLib::FetchBiCharLE(), ystdex::fexists(), ystdex::path< _tSeqCon, _tNorm >::get_norm(), platform::GetFileSizeOf(), ystdex::ifile_iterator::ifile_iterator(), CHRLib::MakeUCS2LEString(), CHRLib::MBCSToUCS2(), CHRLib::MBCToUC(), ystdex::next_if(), ystdex::next_if_eq(), ystdex::ntctscmp(), ystdex::ntctsicmp(), ystdex::ntctslen(), platform_ex::COMPtr< _iCOM >::operator*(), ystdex::pointer_iterator< _type >::operator*(), ystdex::indirect_input_iterator< _tIterator >::operator*(), ystdex::bitseg_iterator< _vN, _bEndian >::operator*(), ystdex::pointer_iterator< _type >::operator++(), ystdex::indirect_input_iterator< _tIterator >::operator++(), ystdex::bitseg_iterator< _vN, _bEndian >::operator++(), ystdex::pointer_iterator< _type >::operator+=(), ystdex::bitseg_iterator< _vN, _bEndian >::operator+=(), ystdex::bitseg_iterator< _vN, _bEndian >::operator--(), ystdex::pointer_iterator< _type >::operator-=(), ystdex::pointer_iterator< _type >::operator[](), CHRLib::strdup(), CHRLib::UCS2Mapper(), CHRLib::UCS2ToMBCS(), CHRLib::UCS4ToUCS2(), CHRLib::ucsdup(), CHRLib::UCToMBC(), platform::ufexists(), platform::ufopen(), ystdex::any::unsafe_any_cast() , 以及 platform::uopen().

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

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

自从
build 245

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

在文件 ydef.h722 行定义.

参考自 YSLib::UI::AccessWidget(), YSLib::UI::Styles::AddHandlers(), YSLib::AddUnique(), ystdex::any::any(), ystdex::any_input_iterator< _type, _tDifference, _tPointer, _tReference >::any_input_iterator(), ystdex::assign(), ytest::timing::average(), YSLib::CacheLookup(), ystdex::call_once(), ystdex::call_once_init< _type, _tOnceFlag >::call_once_init(), YSLib::CollectNodes(), YSLib::UI::CreateUniqueWidget(), YSLib::UI::Styles::StyleMap::DefGetter(), YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::emplace(), ystdex::forward_as_array(), ystdex::variadic_param< _vN >::get(), ystdex::variadic_param< 0U >::get(), ystdex::get_init(), YSLib::GHEvent< _tRet(_tParams...)>::GHEvent(), YSLib::GEventWrapper< EventT(HPaintEvent), YSLib::UI::UIEventArgs && >::ImplI(), ystdex::call_once_init< _type, _tOnceFlag >::init(), ystdex::initializer_cast(), YSLib::UI::InsertWidget(), platform::Logger::Log(), ystdex::make_expanded(), ystdex::make_shared(), ystdex::transformed_iterator< _tIterator, _fTransformer >::make_transform(), ystdex::make_unique(), YSLib::ValueNode::MakeNode(), YSLib::UI::MakeWidgetHandlerAdaptor(), ystdex::nifty_counter< _type >::nifty_counter(), ytest::timing::once(), ytest::timing::once_c(), YSLib::ExpandMemberFirst< _type, _tRet, _tPara, _tNew >::operator()(), YSLib::ExpandMemberFirstBinder< _type, _tRet, _tPara, _tNew >::operator()(), ystdex::container_inserter< _tCon >::operator()(), ystdex::expanded_caller< _fHandler, _fCallable >::operator()(), YSLib::GDependencyEvent< _tEvent, _tOwnerPointer >::operator()(), YSLib::GHandlerAdaptor< _type, _fCallable >::operator()(), ystdex::transformed_iterator< _tIterator, _fTransformer >::operator*(), ystdex::pod_storage< non_aggregate_pod >::operator=(), ystdex::operator|(), YSLib::PackNodes(), ystdex::pod_storage< non_aggregate_pod >::pod_storage(), YSLib::PostTask(), YSLib::Drawing::PutText(), YSLib::UI::GAnimationSession< YSLib::UI::InvalidationUpdater >::Reset(), YSLib::Drawing::ScrDraw(), ystdex::seq_apply(), ystdex::seq_insert(), YSLib::StringifyToNode(), YSLib::UI::Styles::StyleMap::StyleMap(), ytest::timing::total(), ytest::timing::total_c(), YSLib::UnpackToNode(), ystdex::unseq_apply(), ystdex::unsequenced(), ystdex::varg() , 以及 YSLib::GEvent< _tRet(_tParams...)>::yimpl().

#define ynoexcept (   ...)

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

自从
build 319

在文件 ydef.h526 行定义.

#define ynothrow   ythrow()

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

注解
YB_IMPL_MSCPP >= 1200 时支持 __declspec(nothrow) 行为和 throw() 基本一致, 但语法(顺序)不同。
指定 ynothrow 的函数具有 wide constraint , 即保证违反前置条件不引起未定义行为。
参见
ynothrowv
ynoexcept

在文件 ydef.h514 行定义.

参考自 YSLib::DeclI().

#define ynothrowv

YSLib 无异常抛出保证验证:有条件地使用无异常抛出规范。

注解
指定 ynothrowv 的函数具有 narrow constraint , 即不保证违反前置条件时不引起未定义行为。
参见
ynothrow
自从
build 461

按 ISO/IEC JTC1/SC22/WG21 N3248 要求,表示 narrow constraint 的无异常抛出接口。 对应接口违反约束可导致未定义行为。仅当验证时使用显式异常规范。

在文件 ydef.h494 行定义.

#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)))
#define ynoexcept(...)
YSLib 无异常抛出保证:指定特定的异常规范。
Definition: ydef.h:526
成员偏移计算静态类型检查。
Definition: ydef.h:681

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

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

在文件 ydef.h707 行定义.

#define ythread   static

线程局部存储:若实现支持,指定为 thread_local

自从
build 425
待办事项:
加入 __thread__declspec(thread)

在文件 ydef.h539 行定义.

参考自 ystdex::nifty_counter< _type >::get_count() , 以及 ystdex::nifty_counter< _type >::get_object_ptr().

#define ythrow (   ...)

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

注解
ythrow = "yielded throwing" 。

在文件 ydef.h476 行定义.

#define yunseq   ystdex::unsequenced

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

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

在文件 ydef.h748 行定义.

参考自 YSLib::DS::UI::DualScreenReader::AdjustMargins(), YSLib::UI::AScrollBar::AScrollBar(), YSLib::Drawing::Shaders::BlendCore(), YSLib::Drawing::BlitBounds(), YSLib::UI::Caret::Caret(), YSLib::UI::GUIState::CheckHeldState(), platform_ex::ClearKeyStates(), YSLib::Drawing::TextRegion::ClearLine(), YSLib::UI::Control::Control(), YSLib::Text::CopySliceFrom(), YSLib::UI::DecorateAsCloseButton(), YSLib::UI::DialogBox::DialogBox(), YSLib::UI::DialogPanel::DialogPanel(), YSLib::Drawing::Rect::Diminish(), YSLib::UI::DrawItems(), YSLib::Drawing::DrawPolygon(), YSLib::Drawing::FetchStringOffsets(), CHRLib::FillByte(), YSLib::UI::HoverUpdater::HoverUpdater(), YSLib::DS::UI::DualScreenReader::LoadText(), main(), YSLib::UI::Menu::Menu(), ystdex::ntctscmp(), ystdex::ntctsicmp(), YSLib::DS::ShlDS::OnInput(), ystdex::openmode_conv(), YSLib::Drawing::CopyLine< _bPositiveScan >::operator()(), ystdex::pair_iterator< _tMaster, _tSlave, _tTraits >::operator+(), YSLib::Text::TextFileBuffer::iterator::operator++(), ystdex::pair_iterator< _tMaster, _tSlave, _tTraits >::operator++(), ystdex::bitseg_iterator< _vN, _bEndian >::operator++(), YSLib::Drawing::Padding::operator+=(), YSLib::Drawing::GBinaryGroup< SPos >::operator+=(), YSLib::UI::MenuHost::operator+=(), ystdex::pair_iterator< _tMaster, _tSlave, _tTraits >::operator+=(), ystdex::bitseg_iterator< _vN, _bEndian >::operator+=(), ystdex::pair_iterator< _tMaster, _tSlave, _tTraits >::operator-(), ystdex::pair_iterator< _tMaster, _tSlave, _tTraits >::operator--(), ystdex::bitseg_iterator< _vN, _bEndian >::operator--(), YSLib::Drawing::GBinaryGroup< SPos >::operator-=(), ystdex::pair_iterator< _tMaster, _tSlave, _tTraits >::operator-=(), YReader::SettingPanel::operator<<(), YReader::SettingPanel::operator>>(), YSLib::UI::ProgressBar::ProgressBar(), NPL::LexicalAnalyzer::PushEscape(), YSLib::UI::ProgressBar::Refresh(), YSLib::UI::HexViewArea::Refresh(), YSLib::UI::InputTimer::RefreshHeld(), YSLib::UI::MTextList::RefreshTextState(), YSLib::UI::GUIState::Reset(), YSLib::Drawing::ScrDraw(), YSLib::Drawing::TextRegion::Scroll(), YSLib::UI::ColorBox::SetColor(), YSLib::DS::UI::DualScreenReader::SetLineGap(), YSLib::Drawing::Font::SetStyle(), YReader::ShlTextReader::SettingSession::SettingSession(), YSLib::Drawing::Typeface::SmallBitmapData::SmallBitmapData(), ystdex::starts_width(), platform::StartTicks(), YSLib::UI::TextBox::TextBox(), YSLib::TextFile::TextFile(), YSLib::UI::Thumb::Thumb(), NPL::TransformNPLA1(), YSLib::DS::UI::DualScreenReader::UnloadText(), ystdex::unseq_apply(), YSLib::Devices::InputManager::Update(), YReader::ShlTextReader::UpdateButtons(), YSLib::UI::GUIState::UpdateChar(), YReader::ReaderBox::UpdateData(), YReader::TextInfoBox::UpdateData(), YSLib::UI::HexViewArea::UpdateData(), YSLib::UI::TabControl::UpdateTabPages(), YSLib::UI::View::View(), YSLib::UI::BorderResizer::Wrap() , 以及 YSLib::UI::GUIState::Wrap().