From 12e4cd3b77518ec2a5711a80feb5ca4ead8df023 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 9 Dec 2022 20:16:08 +0330 Subject: [PATCH] AK: Allow the user to access the variant index The average user has no need for this, but the Jakt compiler uses this to avoid going through the expensive ::visit() and ::get<>() APIs. --- AK/Variant.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AK/Variant.h b/AK/Variant.h index 01e52dd6ee..6290c483de 100644 --- a/AK/Variant.h +++ b/AK/Variant.h @@ -463,6 +463,8 @@ public: } } + auto index() const { return m_index; } + private: template Variant downcast_variant(TypeWrapper>) &&