From dee82f64372960254a9a0a1ccea58ffa2c427391 Mon Sep 17 00:00:00 2001 From: kayomn Date: Thu, 2 Mar 2023 20:02:39 +0000 Subject: [PATCH] Re-organize coral::enumerator functions for easier reading --- source/coral.cpp | 16 ++++++++-------- source/coral/files.cpp | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/coral.cpp b/source/coral.cpp index 1f2a130..494ccfc 100755 --- a/source/coral.cpp +++ b/source/coral.cpp @@ -502,14 +502,6 @@ export namespace coral { template struct enumerator { virtual ~enumerator() {} - /** - * Returns the last-enumerated value. - * - * *Note*: calling this function before first having recieved a `true` value from [enumerate] will result in - * implementation-defined behaviour. - */ - virtual type value() = 0; - /** * Attempts to retrieve the next file path in the file tree, returning true if another value was retrieved or * `false` if there are no more values to be enumerated over. @@ -523,6 +515,14 @@ export namespace coral { * The enumerated value may be accessed through [value]. */ virtual bool enumerate() = 0; + + /** + * Returns the last-enumerated value. + * + * *Note*: calling this function before first having recieved a `true` value from [enumerate] will result in + * implementation-defined behaviour. + */ + virtual type value() = 0; }; } diff --git a/source/coral/files.cpp b/source/coral/files.cpp index c28e72f..3a0a87d 100755 --- a/source/coral/files.cpp +++ b/source/coral/files.cpp @@ -26,16 +26,16 @@ export namespace coral { struct file_walker : public enumerator, io_error>> { virtual ~file_walker() {} + /** + * See [enumerator::enumerate]. + */ + virtual bool enumerate() = 0; + /** * Returns the last-enumerated path as a sequence of `char`s or an [io_error] if the last enumeration did not * successfully complete. */ virtual expected, io_error> value() = 0; - - /** - * See [enumerator::enumerate]. - */ - virtual bool enumerate() = 0; }; /**