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
14
20
28template <typename T>
30private:
35 constexpr const T& derived() const noexcept {
36 return static_cast<const T&>(*this);
37 }
38
39public:
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
62#endif // MSTL_CORE_INTERFACE_ICOLLECTOR_HPP__
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
基本接口基类
集合器接口模板
MSTL_NODISCARD constexpr decltype(auto) size() const noexcept(noexcept(derived().size()))
获取集合大小
MSTL_NODISCARD constexpr bool empty() const noexcept(noexcept(derived().empty()))
检查集合是否为空
可比较对象接口模板
MSTL类型擦除辅助函数