From 78ef7e804ff5ec6759ef6bdd197ca04a29fbfea5 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 12 Feb 2024 21:46:33 +0200 Subject: [PATCH] BAN: Implement bit_cast --- BAN/include/BAN/Bitcast.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 BAN/include/BAN/Bitcast.h diff --git a/BAN/include/BAN/Bitcast.h b/BAN/include/BAN/Bitcast.h new file mode 100644 index 0000000000..e025a91b2e --- /dev/null +++ b/BAN/include/BAN/Bitcast.h @@ -0,0 +1,12 @@ +#pragma once + +namespace BAN +{ + + template + constexpr To bit_cast(const From& from) + { + return __builtin_bit_cast(To, from); + } + +}