MSTL
1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
icollector.hpp
浏览该文件的文档.
1
#ifndef MSTL_CORE_INTERFACE_ICOLLECTOR_HPP__
2
#define MSTL_CORE_INTERFACE_ICOLLECTOR_HPP__
3
10
11
#include "
MSTL/core/algorithm/type_erase.hpp
"
12
#include "
MSTL/core/interface/icommon.hpp
"
13
MSTL_BEGIN_NAMESPACE__
14
20
28
template
<
typename
T>
29
struct
icollector
:
icomparable
<T> {
30
private
:
35
constexpr
const
T& derived()
const
noexcept
{
36
return
static_cast<
const
T&
>
(*this);
37
}
38
39
public
:
44
MSTL_NODISCARD
constexpr
decltype
(
auto
)
size
() const
45
noexcept(noexcept(derived().
size
())) {
46
return
derived().size();
47
}
48
53
MSTL_NODISCARD
constexpr
bool
empty
() const
54
noexcept(noexcept(derived().
empty
())) {
55
return
derived().empty();
56
}
57
};
58
// CRTPInterfaces
60
61
MSTL_END_NAMESPACE__
62
#endif
// MSTL_CORE_INTERFACE_ICOLLECTOR_HPP__
MSTL_END_NAMESPACE__
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
定义
c++config.hpp:268
MSTL_BEGIN_NAMESPACE__
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
定义
c++config.hpp:262
icommon.hpp
基本接口基类
icollector
集合器接口模板
定义
icollector.hpp:29
icollector::size
MSTL_NODISCARD constexpr decltype(auto) size() const noexcept(noexcept(derived().size()))
获取集合大小
定义
icollector.hpp:44
icollector::empty
MSTL_NODISCARD constexpr bool empty() const noexcept(noexcept(derived().empty()))
检查集合是否为空
定义
icollector.hpp:53
icomparable
可比较对象接口模板
定义
icommon.hpp:67
type_erase.hpp
MSTL类型擦除辅助函数
include
MSTL
core
interface
icollector.hpp
制作者
1.16.0