Fix fs::dir (const begin/end)

This commit is contained in:
Nekotekina 2017-11-15 20:56:31 +03:00
parent 0d1cb8c878
commit 3792a85084

View file

@ -422,7 +422,7 @@ namespace fs
class iterator class iterator
{ {
dir* m_parent; const dir* m_parent;
dir_entry m_entry; dir_entry m_entry;
public: public:
@ -432,7 +432,7 @@ namespace fs
from_current from_current
}; };
iterator(dir* parent, mode mode_ = mode::from_first) iterator(const dir* parent, mode mode_ = mode::from_first)
: m_parent(parent) : m_parent(parent)
{ {
if (!m_parent) if (!m_parent)
@ -468,12 +468,12 @@ namespace fs
} }
}; };
iterator begin() iterator begin() const
{ {
return {m_dir ? this : nullptr}; return {m_dir ? this : nullptr};
} }
iterator end() iterator end() const
{ {
return {nullptr}; return {nullptr};
} }