MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
file_line_iterator.hpp
1#ifndef MSTL_CORE_ITERATOR_FILE_LINE_ITERATOR_HPP__
2#define MSTL_CORE_ITERATOR_FILE_LINE_ITERATOR_HPP__
3#include "../file/file_constants.hpp"
4#include "../string/string.hpp"
6
7class MSTL_API file_line_iterator {
8public:
9 using value_type = string;
10 using reference = const string&;
11 using pointer = const string*;
12 using iterator_category = input_iterator_tag;
13 using difference_type = ptrdiff_t;
14
15private:
16 const file* file_ = nullptr;
17 mutable string current_line_;
18
19public:
20 file_line_iterator() = default;
21 explicit file_line_iterator(const file* f);
22
23 reference operator *() const noexcept { return current_line_; }
24 pointer operator ->() const noexcept { return &current_line_; }
25
26 file_line_iterator& operator ++();
27 file_line_iterator operator ++(int);
28
29 bool operator ==(const file_line_iterator& b) const noexcept {
30 return file_ == b.file_;
31 }
32 bool operator !=(const file_line_iterator& b) const noexcept {
33 return !(*this == b);
34 }
35};
36
38#endif // MSTL_CORE_ITERATOR_FILE_LINE_ITERATOR_HPP__
constexpr duration< _INNER __common_rep_t< Rep1, Rep2 >, Period > operator*(const duration< Rep1, Period > &value, const Rep2 &scalar)
乘法运算符(持续时间 * 标量)
bool operator!=(const function< Res(Args...)> &f, nullptr_t null) noexcept
不等于空指针比较
bool operator==(const function< Res(Args...)> &f, nullptr_t null) noexcept
等于空指针比较
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
int64_t ptrdiff_t
指针差类型