AK: Use C++20 concepts to only allow Userspace wrappers of pointers

It was a bit odd that you could create a Userspace<int> and that
Userspace<int>::ptr() returned an int instead of an int*.

Let's use C++20 concepts to only allow creating Userspace objects with
pointer types. :^)
This commit is contained in:
Emanuele Torre 2020-08-01 07:13:50 +02:00 committed by Andreas Kling
parent 75a4b1a27e
commit 5bf994d2d9
Notes: sideshowbarker 2024-07-19 04:24:50 +09:00

View File

@ -26,11 +26,15 @@
#pragma once
#include <AK/StdLibExtras.h>
#include <AK/Types.h>
namespace AK {
template<typename T>
concept PointerTypeName = IsPointer<T>::value;
template<PointerTypeName T>
class Userspace {
public:
Userspace() { }