28 #ifndef YB_INC_ystdex_utility_hpp_
29 #define YB_INC_ystdex_utility_hpp_ 1
41 class YB_API unsupported :
public std::logic_error
46 : logic_error(
"Unsupported operation found.")
48 template<
typename _type>
62 template<
typename _type>
166 template<
typename _type>
170 return std::forward<_type>(arg);
180 template<
typename _type>
181 typename qualified_decay<_type>::type
184 return std::forward<_type>(arg);
194 template<
typename _type,
size_t _vN>
200 template<
typename _type,
size_t _vN>
214 template<
typename _type>
219 template<
typename... _tParams>
242 template<
typename _type>
256 template<
typename _fCallable,
typename... _tParams>
274 template<
typename _type,
typename,
typename...>
288 template<
typename _type,
size_t...>
307 template<
typename _tKey,
typename... _tKeys,
typename _fInit,
308 typename... _tParams>
314 auto& p(ystdex::parameterize_static_object<obj_type*, _tKey, _tKeys...>());
328 template<
size_t... _vKeys,
typename _fInit,
typename... _tParams>
334 auto& p(ystdex::parameterize_static_object<obj_type*, _vKeys...>());
363 template<
class _type>
369 template<
typename... _tParams>
437 template<
typename _type,
typename _tOnceFlag>
444 template<
typename... _tParams>
486 template<
typename... _tParams>
502 #if !YB_HAS_BUILTIN_NULLPTR
unimplemented(_type &&arg)
noncopyable()=default
protected 构造:默认实现。
size_t arrlen(_type(&)[_vN])
计算指定数组类型对象的长度。
static void init(_tParams &&...args)
static size_t & get_count()
yconstfn const string _tParams && args
nonmovable & operator=(const nonmovable &)=delete
禁止赋值复制。
const class ystdex::nullptr_t nullptr
static flag_type & get_uninit_flag()
static object_type *& get_object_ptr()
qualified_decay< _type >::type decay_forward(_type &&arg)
退化传递。
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
nonmovable()=default
protected 构造:默认实现。
nifty_counter(_tParams &&...args)
不可复制对象:禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
noncopyable & operator=(const noncopyable &)=delete
禁止赋值复制。
static object_type *& get_object_ptr()
#define YB_API
YBase 应用程序编程接口:用于向库文件约定链接。
conditional_t< std::is_class< _type >::value, _type, boxed_value< _type >> classify_value_t
包装非类类型为类类型。
boxed_value(_tParams &&...args)
#define yconstfn
指定编译时常量函数。
~noncopyable()=default
protected 析构:默认实现。
auto get_init(_fInit &&f, _tParams &&...args) -> decltype(f(std::forward< decltype(args)>(args)...))&
取类型标识和初始化调用指定的对象。
call_once_init(_tParams &&...args)
_type & parameterize_static_object()
类型参数化静态对象。
~nonmovable()=default
protected 析构:默认实现。
#define ythread
线程局部存储:若实现支持,指定为 thread_local 。
void call_once(bool &b, _fCallable &&f, _tParams &&...args)
按标识调用函数,保证调用一次。
static flag_type & get_init_flag()
static size_t use_count()
decay_t< _type > decay_copy(_type &&arg)
退化复制。