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
29
template
<
typename
T>
30
struct
icollector
:
icomparable
<T> {
31
private
:
32
constexpr
const
T& derived()
const
noexcept
{
return
static_cast<
const
T&
>
(*this); }
33
34
public
:
39
NEFORCE_NODISCARD
constexpr
decltype
(
auto
)
size
() const noexcept(noexcept(derived().
size
())) {
40
return
derived().size();
41
}
42
47
NEFORCE_NODISCARD
constexpr
bool
empty
() const noexcept(noexcept(derived().
empty
())) {
return
derived().empty(); }
48
};
49
// CRTPInterfaces
51
52
NEFORCE_END_NAMESPACE__
53
#endif
// NEFORCE_CORE_INTERFACE_ICOLLECTOR_HPP__
icommon.hpp
基本接口基类
icollector
集合器接口模板
定义
icollector.hpp:30
icollector::size
constexpr decltype(auto) size() const noexcept(noexcept(derived().size()))
获取集合大小
定义
icollector.hpp:39
icollector::empty
constexpr bool empty() const noexcept(noexcept(derived().empty()))
检查集合是否为空
定义
icollector.hpp:47
icomparable
可比较对象接口模板
定义
icommon.hpp:80
include
NeForce
core
interface
icollector.hpp
制作者
1.16.0