Created
March 26, 2022 18:17
-
-
Save vikingosegundo/59f44aebc253e20e994b6321b298dcb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:_Stack<String> = createStack() | |
s.push("one") | |
s.push("two") | |
s.push("three") | |
let o = Stack(s) | |
o.push("four") | |
let t = Stack.Transcoder(stack: o) | |
let jsonData = try! JSONEncoder().encode(t) | |
let o2 = (try! JSONDecoder().decode(Stack<String>.Transcoder.self, from: jsonData)).stack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment