Add bt2::Common{Field,FieldClass,Value,Message}<>::as<>()
[babeltrace.git] / src / cpp-common / bt2 / value.hpp
index 5f265236489bda91b73f0ba62f1f3c4fda8f685d..a065af6c0c8715dec1c129847c6afde4c9d2ccb2 100644 (file)
@@ -212,6 +212,12 @@ public:
         return Shared::createWithRef(*this);
     }
 
+    template <typename ValueT>
+    ValueT as() const noexcept
+    {
+        return ValueT {this->libObjPtr()};
+    }
+
     CommonNullValue<LibObjT> asNull() const noexcept;
     CommonBoolValue<LibObjT> asBool() const noexcept;
     CommonSignedIntegerValue<LibObjT> asSignedInteger() const noexcept;
This page took 0.023177 seconds and 4 git commands to generate.