I tried to find out but couldn't fine any solution. So, asking you guys.
Is there any chance to write a func which is return as generic type?
I have a structure as below
struct WWSInterest: Unboxable {
    var confirmation: Bool
    var data: [WWSKeyValue]?
    var message: String?
    init(unboxer: Unboxer) throws {
        self.confirmation = try! unboxer.unbox(key: "confirmation")
        self.data = try? unboxer.unbox(key: "data")
        self.message = try? unboxer.unbox(key: "message")
    }
//    static func createFrom(data: Data) -> WWSInterest? {
//        do {
//            let r: WWSInterest = try unbox(data: data)
//            return r
//        } catch {
//            return nil
//        }
//    }
}
and i want to helper func like below
func create<T>(from data: Data) -> T? {
    do {
        let r: T = try unbox(data: data)
        return r
    } catch {
        return nil
    }
}
Is that possible?
BTW: Sorry my bad English
// Edit
WWSKeyValue is struct as below,
struct WWSKeyValue: Unboxable {
    var key: String
    var value: String
    init(unboxer: Unboxer) throws {
        self.key = try! unboxer.unbox(key: "key")
        self.value = try! unboxer.unbox(key: "value")
    }
}