From 981a49bbc618c90ef868e9cd06c431fb8d6728fe Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 12 Dec 2025 04:53:39 +0100 Subject: chore: update WG01 DDK example. Signed-off-by: Amlal El Mahrouss --- source/wg01/wg01.tex | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/wg01/wg01.tex b/source/wg01/wg01.tex index 328accb..73c8e33 100644 --- a/source/wg01/wg01.tex +++ b/source/wg01/wg01.tex @@ -105,11 +105,11 @@ The following example shows how powerful C++ can be when combining it with Devic /// @brief This concept requires the driver /// to be IDriverBase compliant. -constexpr auto kInvalidType = 0; +inline constexpr auto kInvalidType = 0; -template -concept IsValidDriver = requires(T a) { - { a.IsActive() && a.Type() > kInvalidType }; +template +concept IsValidDriver = requires(Driver drv) { + { drv.IsActive() && drv.Type() > kInvalidType }; }; /// @brief Consteval helper to detect @@ -151,14 +151,15 @@ public: }; int main() { - B* callImpl = new B(); - callImpl->doImpl(); + B callImpl; + callImpl.doImpl(); } \end{lstlisting} \section{Addressing V-Tables in a C++ Kernel.} -Now the problem with kernel development is that we want to avoid such feature as much as possible, and we'd do that by following the Prong on Inheritance: +Now the problem with kernel development is that we want to avoid such feature as much as possible, \\ +and we'd do that by following the Prong on Inheritance: \subsection{The Three Prongs on Inheritance:} -- cgit v1.2.3