mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:17:34 +00:00
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:
parent
75a4b1a27e
commit
5bf994d2d9
1 changed files with 4 additions and 0 deletions
|
@ -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() { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue