Add bt2::Common{Field,FieldClass,Value,Message}<>::as<>()
[babeltrace.git] / src / cpp-common / bt2 / field.hpp
index 25d0034ffe4bbb18f3869abc8bc545c9dfea6579..f1908b9923a84760d196deacdcd499b6d3c7ef47 100644 (file)
@@ -204,6 +204,12 @@ public:
         return this->cls().isVariant();
     }
 
+    template <typename FieldT>
+    FieldT as() const noexcept
+    {
+        return FieldT {this->libObjPtr()};
+    }
+
     CommonBoolField<LibObjT> asBool() const noexcept;
     CommonBitArrayField<LibObjT> asBitArray() const noexcept;
     CommonUnsignedIntegerField<LibObjT> asUnsignedInteger() const noexcept;
This page took 0.025742 seconds and 4 git commands to generate.