NexusForce
1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
icollector.hpp
浏览该文件的文档.
1
#ifndef NEFORCE_CORE_INTERFACE_ICOLLECTOR_HPP__
2
#define NEFORCE_CORE_INTERFACE_ICOLLECTOR_HPP__
3
10
11
#include "
NeForce/core/interface/icommon.hpp
"
12
NEFORCE_BEGIN_NAMESPACE__
13
19
27
template
<
typename
T>
28
struct
icollector
:
icomparable
<T> {
29
private
:
30
constexpr
const
T& derived()
const
noexcept
{
return
static_cast<
const
T&
>
(*this); }
31
32
public
:
37
NEFORCE_NODISCARD
constexpr
decltype
(
auto
)
size
() const noexcept(noexcept(derived().
size
())) {
38
return
derived().size();
39
}
40
45
NEFORCE_NODISCARD
constexpr
bool
empty
() const noexcept(noexcept(derived().
empty
())) {
return
derived().empty(); }
46
};
47
// CRTPInterfaces
49
50
NEFORCE_END_NAMESPACE__
51
#endif
// NEFORCE_CORE_INTERFACE_ICOLLECTOR_HPP__
icommon.hpp
基本接口基类
icollector
集合器接口模板
定义
icollector.hpp:28
icollector::size
NEFORCE_NODISCARD constexpr decltype(auto) size() const noexcept(noexcept(derived().size()))
获取集合大小
定义
icollector.hpp:37
icollector::empty
NEFORCE_NODISCARD constexpr bool empty() const noexcept(noexcept(derived().empty()))
检查集合是否为空
定义
icollector.hpp:45
icomparable
可比较对象接口模板
定义
icommon.hpp:80
include
NeForce
core
interface
icollector.hpp
制作者
1.16.0