YSTest: examiner.hpp 源文件

YSTest PreAlpha_b400_20130424 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) = false)
52 ynoexcept(ynoexcept(x == y))
53 {
54 return x == y;
55 }
56 };
57
58
63 struct always_equal
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;
81 using always_equal::are_equal;
82 };
83
84 } // namespace examiners;
85
86 } // namespace ystdex;
87
88 #endif
89