Sfoglia il codice sorgente

AK: Export Details and Concepts into the AK namespace

AK internals like to use concepts and details without a fully qualified
name, which usually works just fine because we make everything
AK-related available to the unqualified namespace.

However, this breaks as soon as we start not using `USING_AK_GLOBALLY`,
due to those identifiers no longer being made available. Instead, we
just export those into the `AK` namespace instead.
Tim Schumacher 2 anni fa
parent
commit
03fd9002da
2 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 5 1
      AK/Concepts.h
  2. 5 1
      AK/StdLibExtraDetails.h

+ 5 - 1
AK/Concepts.h

@@ -121,7 +121,9 @@ concept FallibleFunction = requires(Func&& func, Args&&... args) {
 // clang-format on
 }
 
-#if USING_AK_GLOBALLY
+#if !USING_AK_GLOBALLY
+namespace AK {
+#endif
 using AK::Concepts::Arithmetic;
 using AK::Concepts::ArrayLike;
 using AK::Concepts::Enum;
@@ -139,4 +141,6 @@ using AK::Concepts::Signed;
 using AK::Concepts::SpecializationOf;
 using AK::Concepts::Unsigned;
 using AK::Concepts::VoidFunction;
+#if !USING_AK_GLOBALLY
+}
 #endif

+ 5 - 1
AK/StdLibExtraDetails.h

@@ -615,7 +615,9 @@ inline constexpr bool IsOneOfIgnoringCV = (IsSameIgnoringCV<T, Ts> || ...);
 
 }
 
-#if USING_AK_GLOBALLY
+#if !USING_AK_GLOBALLY
+namespace AK {
+#endif
 using AK::Detail::AddConst;
 using AK::Detail::AddConstToReferencedType;
 using AK::Detail::AddLvalueReference;
@@ -685,4 +687,6 @@ using AK::Detail::RemoveVolatile;
 using AK::Detail::TrueType;
 using AK::Detail::UnderlyingType;
 using AK::Detail::Void;
+#if !USING_AK_GLOBALLY
+}
 #endif