Skip to content

Commit

Permalink
PathFuncs: correct helper comment
Browse files Browse the repository at this point in the history
Summary:
# This diff
fixes a comment to be more clear about the current language limitations

# context

I spent some time refactoring the code to remove this helper since I thought C++20 would remove the need for it. However, I soon discovered that the constructor added in C++20 is not noexcept, so we cannot utilize it directly. Therefore, we must continue to use this helper. Clarify the comment to avoid other people wasting their time in the future :)

Reviewed By: jdelliot

Differential Revision: D66115291

fbshipit-source-id: 634fcf4ddbe8749b4c52f5f24dc14ef663946d8c
  • Loading branch information
MichaelCuevas authored and facebook-github-bot committed Nov 18, 2024
1 parent b7217e4 commit 1a2e484
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eden/common/utils/PathFuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ T move_or_copy(T& t) noexcept {
}

/**
* C++20 introduces this constructor for std::string_view, but EdenFS is C++17.
* C++20 introduces this constructor for std::string_view. However, this doesn't
* matter for our use case, since the new constructor is not NOEXCEPT and
* therefore cannot be utilized in many places.
*/
inline std::string_view string_view_range(const char* begin, const char* end) {
XDCHECK_LE(begin, end);
Expand Down

0 comments on commit 1a2e484

Please sign in to comment.