public SwiftOptional <T> Next()
 {
     if (enumerator.MoveNext())
     {
         return(SwiftOptional <T> .Some(enumerator.Current));
     }
     else
     {
         return(SwiftOptional <T> .None());
     }
 }
        public T CastAs <T> () where T : class, ISwiftObject
        {
            var metaType = StructMarshal.Marshaler.Metatypeof(typeof(T));

            using (var optional = SwiftOptional <T> .None()) {
                unsafe
                {
                    fixed(byte *dataPtr = StructMarshal.Marshaler.PrepareNominal(optional))
                    {
                        NativeMethodsForSwiftAnyObject.CastAs(new IntPtr(dataPtr), SwiftObject, metaType);
                        return(optional.HasValue ? optional.Value : default(T));
                    }
                }
            }
        }