diff --git a/include/mqt-core/na/operations/Op.hpp b/include/mqt-core/na/operations/Op.hpp index ec1bab25a..a2cc96743 100644 --- a/include/mqt-core/na/operations/Op.hpp +++ b/include/mqt-core/na/operations/Op.hpp @@ -11,9 +11,11 @@ #include #include +#include namespace na { -class Op { +template class... Traits> +class Op : public Traits... { public: Op() = default; virtual ~Op() = default; @@ -21,8 +23,16 @@ class Op { friend auto operator<<(std::ostream& os, const Op& obj) -> std::ostream& { return os << obj.toString(); // Using toString() method } - template [[nodiscard]] auto is() const -> bool { - return dynamic_cast(this) != nullptr; + /// Checks whether the object has the template parameter as a trait. + template