Hide create_directory function overload with ec#198
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR hides the create_directory overload that accepts an std::error_code parameter from the public API while ensuring the throwing overload remains accessible.
- Removed the overload declaration with std::error_code from src/create.hpp.
- Moved the implementation of the error-code overload into an unnamed namespace in src/create.cpp and reintroduced the public throwing overload.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/create.hpp | Removed declaration of the create_directory overload that takes ec. |
| src/create.cpp | Internalized the error-reporting overload in an unnamed namespace and reordered function definitions. |
Comments suppressed due to low confidence (1)
src/create.cpp:106
- [nitpick] Consider annotating or renaming this internal overload to clearly indicate it is for internal error reporting, which can help prevent accidental misuse and improve code maintainability.
fs::path create_directory(std::string_view prefix, std::error_code& ec) {
There was a problem hiding this comment.
Pull Request Overview
This PR hides the error_code overload of the create_directory function and refactors the file API to use a single public interface.
- Removed the public declaration of the create_directory overload with std::error_code in the header.
- Moved and restructured internal error_code–based implementations in the source file.
- Consolidated similar error handling patterns for temporary file creation across platforms.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/create.hpp | Removed the error_code overload declarations from the public API. |
| src/create.cpp | Reorganized the internal implementations and moved the public overloads to invoke the hidden error_code versions. |
Comments suppressed due to low confidence (1)
src/create.cpp:190
- [nitpick] Consider placing the internal create_directory overload (using std::error_code) into an anonymous namespace or marking it static so that its separation from the public API is clearer.
fs::path create_directory(std::string_view prefix) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed the "public" declaration of the
create_fileandcreate_directoryoverloads withstd::error_code