From ee22a98c17225c3c3d374e9f41fdbaa5a6f7aed1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 27 Dec 2022 20:23:25 -0500 Subject: [PATCH] Add note to future self. --- Machines/Utility/TypedDynamicMachine.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Machines/Utility/TypedDynamicMachine.hpp b/Machines/Utility/TypedDynamicMachine.hpp index d1e9d0530..5e60226cc 100644 --- a/Machines/Utility/TypedDynamicMachine.hpp +++ b/Machines/Utility/TypedDynamicMachine.hpp @@ -49,6 +49,18 @@ template class TypedDynamicMachine: public ::Machine::DynamicMachine private: template Class *get() { return dynamic_cast(machine_.get()); + + // Note to self: the below is not [currently] used + // because in practice TypedDynamicMachine is instantiated + // with an abstract parent of the actual class. + // + // TODO: rethink type hiding here. I think I've boxed myself + // into an uncomfortable corner. +// if constexpr (std::is_base_of_v) { +// return static_cast(machine_.get()); +// } else { +// return nullptr; +// } } std::unique_ptr machine_; };