AK: Move TimeSpecType concept inside the AK namespace

This is just to allow removing the 'clang-format off' directive. This
concept is only used within this header, so it doesn't need to be in the
global namespace.
This commit is contained in:
Timothy Flynn 2022-01-05 11:49:17 -05:00 committed by Linus Groh
parent 8f5c1ef29c
commit 0c75a14b4f
Notes: sideshowbarker 2024-07-17 21:34:58 +09:00

View file

@ -15,6 +15,8 @@
struct timeval;
struct timespec;
namespace AK {
// Concept to detect types which look like timespec without requiring the type.
template<typename T>
concept TimeSpecType = requires(T t)
@ -23,10 +25,6 @@ concept TimeSpecType = requires(T t)
t.tv_nsec;
};
// FIXME: remove once Clang formats these properly.
// clang-format off
namespace AK {
// Month and day start at 1. Month must be >= 1 and <= 12.
// The return value is 0-indexed, that is 0 is Sunday, 1 is Monday, etc.
// Day may be negative or larger than the number of days
@ -298,7 +296,6 @@ inline bool operator!=(const T& a, const T& b)
}
}
// clang-format on
using AK::day_of_week;
using AK::day_of_year;