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
12NEFORCE_BEGIN_NAMESPACE__
13
19
27template <typename T>
29private:
30 constexpr const T& derived() const noexcept { return static_cast<const T&>(*this); }
31
32public:
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
50NEFORCE_END_NAMESPACE__
51#endif // NEFORCE_CORE_INTERFACE_ICOLLECTOR_HPP__
基本接口基类
集合器接口模板
NEFORCE_NODISCARD constexpr decltype(auto) size() const noexcept(noexcept(derived().size()))
获取集合大小
NEFORCE_NODISCARD constexpr bool empty() const noexcept(noexcept(derived().empty()))
检查集合是否为空
可比较对象接口模板