diff --git a/fs/scoped.cpp b/fs/scoped.cpp index db796a9f..e58d9145 100644 --- a/fs/scoped.cpp +++ b/fs/scoped.cpp @@ -28,6 +28,22 @@ scoped_path::scoped_path (std::filesystem::path const &_path) { ; } +//----------------------------------------------------------------------------- +std::filesystem::path const & +scoped_path::operator* () const & +{ + return get (); +} + + +//----------------------------------------------------------------------------- +std::filesystem::path const* +scoped_path::operator-> () const & +{ + return &get(); +} + + //----------------------------------------------------------------------------- std::filesystem::path const& scoped_path::get () const& @@ -74,19 +90,3 @@ scoped_dir::scoped_dir (std::filesystem::path &&_path) { CHECK (std::filesystem::is_directory (get ())); } - - -//----------------------------------------------------------------------------- -std::filesystem::path const & -scoped_dir::operator* () const & -{ - return get (); -} - - -//----------------------------------------------------------------------------- -std::filesystem::path const* -scoped_dir::operator-> () const & -{ - return &get(); -} diff --git a/fs/scoped.hpp b/fs/scoped.hpp index f936969b..c8440f25 100644 --- a/fs/scoped.hpp +++ b/fs/scoped.hpp @@ -27,6 +27,9 @@ namespace cruft::fs { ~scoped_path (); + std::filesystem::path const& operator* (void) const&; + std::filesystem::path const* operator-> (void) const&; + std::filesystem::path const& get (void) const&; std::filesystem::path release (void); @@ -46,8 +49,5 @@ namespace cruft::fs { explicit scoped_dir (std::filesystem::path &&); using scoped_path::scoped_path; - - std::filesystem::path const& operator* () const&; - std::filesystem::path const* operator-> () const&; }; } \ No newline at end of file