         let ptr = pointer
         return ptr.map { $0.assumingMemoryBound(to: T.self) }
     }
+    /// Generic Value accessor for object types.
+    /// - Warning: this method does not check whether the object actually conforms to the given object subtype.  If you want run time safety, you need to check the (meta)type of the returned reference!
+    /// - Returns: the unwrapped value if conforming to object type or `nil`
+    @inlinable func get<O: ObjectProtocol>() -> O? {
+        if typeCheckValueHolds(type: .object)  { let o = object ; return o?.ptr.flatMap { O(raw: $0) } }
+        return nil
+    }
     /// Generic Value accessor for unknown types.
     ///
-    /// - Returns: nil
+    /// - Returns: the unwrapped value if conforming to the given type or `nil`
     @inlinable func get<T>() -> T? {
         if typeCheckValueHolds(type: .boolean) { return boolean as? T }
         if typeCheckValueHolds(type: .string)  { return string  as? T }

        if let v = o as? StaticString { set(v) ; return }
        if let v = o as? ValueBase { set(v) ; return }
        if let v = o as? ValueRef { set(v) ; return }
        if let v = o as? ValueProtocol { set(v) ; return }
        if let v = o as? Object { setObject(vObject: v) ; return }
        if let v = o as? ObjectRef { setObject(vObject: v) ; return }
        if let v = o as? ParamSpec { set(param: v) ; return }
        if let v = o as? ParamSpecRef { set(param: v) ; return }
        unset()
        g_warn_message("GLibObject", #file, #line, #function, "Cannot set \(o) of type \(O.self) as a Value")
    }

//  GLibObject
//
//  Created by Rene Hexel on 17/4/17.
//  Copyright © 2016, 2017, 2018, 2020, 2021 Rene Hexel.  All rights reserved.
//
#if os(macOS) || os(iOS) || os(tvOS)
    import Darwin
