YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
examiner.hpp
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2012 - 2013.
3 
4  This file is part of the YSLib project, and may only be used,
5  modified, and distributed under the terms of the YSLib project
6  license, LICENSE.TXT. By continuing to use, modify, or distribute
7  this file you indicate that you have read the license and
8  understand and accept it fully.
9 */
10 
28 #ifndef YB_INC_ystdex_examiner_hpp_
29 #define YB_INC_ystdex_examiner_hpp_ 1
30 
31 #include "../ydef.h" // for ynoexcept;
32 
33 namespace ystdex
34 {
35 
40 namespace examiners
41 {
42 
47 struct equal
48 {
49  template<typename _type1, typename _type2>
50  static yconstfn YB_PURE bool
51  are_equal(_type1&& x, _type2&& y, decltype(x == y) = {})
52  ynoexcept(ynoexcept(x == y))
53  {
54  return x == y;
55  }
56 };
57 
58 
64 {
65  template<typename _type, typename _tUnused>
66  static yconstfn YB_STATELESS bool
67  are_equal(const _type&, _tUnused) ynothrow
68  {
69  return true;
70  }
71 };
72 
73 
78 struct equal_examiner : public equal, public always_equal
79 {
80  using equal::are_equal;
82 };
83 
84 } // namespace examiners;
85 
86 } // namespace ystdex;
87 
88 #endif
89 
static bool are_equal(const _type &, _tUnused)
Definition: examiner.hpp:67
基本等于操作检测:总是相等。
Definition: examiner.hpp:63
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
等于操作检测。
Definition: examiner.hpp:78
#define YB_PURE
指示函数或函数模板实例为纯函数。
Definition: ydef.h:331
#define YB_STATELESS
指示函数或函数模板实例为无状态函数。
Definition: ydef.h:354
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:463
基本等于操作检测。
Definition: examiner.hpp:47
#define ynoexcept(...)
YSLib 无异常抛出保证:指定特定的异常规范。
Definition: ydef.h:526
static bool are_equal(_type1 &&x, _type2 &&y, decltype(x==y)={})
Definition: examiner.hpp:51