From 5bf994d2d9fffa73f22f25f792e1482dc43a694e Mon Sep 17 00:00:00 2001 From: Emanuele Torre Date: Sat, 1 Aug 2020 07:13:50 +0200 Subject: [PATCH] AK: Use C++20 concepts to only allow Userspace wrappers of pointers It was a bit odd that you could create a Userspace and that Userspace::ptr() returned an int instead of an int*. Let's use C++20 concepts to only allow creating Userspace objects with pointer types. :^) --- AK/Userspace.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AK/Userspace.h b/AK/Userspace.h index 8f02f6d72f5..d499363de6b 100644 --- a/AK/Userspace.h +++ b/AK/Userspace.h @@ -26,11 +26,15 @@ #pragma once +#include #include namespace AK { template +concept PointerTypeName = IsPointer::value; + +template class Userspace { public: Userspace() { }