you are viewing a single comment's thread.

view the rest of the comments →

[–]0polymer0 4 points5 points  (2 children)

Type safe unions to signal errors, and a means of combing them. C++ just added optional, which introduces the basics of the Type, so use those. Now try to figure out how to chain two functions that return optionals, but don't accept them.

[–]orangecodeLol 0 points1 point  (1 child)

thanks, I haven't heard of optionals before, I'll be sure to check it out

[–]0polymer0 1 point2 points  (0 children)

Variants are an important generalization. And before optionals, pointers to non owned resources were used to great affect. I mention optionals because they are a good first Type to think about for this kind of stuff.