I prefer the fallible, if failed return null else return new pattern myself also. With a little RAII, it keeps manual cleanup to a minimum.
On Thu, Apr 21, 2016 at 8:24 PM, Nicholas Nethercote <n.netherc...@gmail.com> wrote: > - It doesn't appear to work with stack-allocated objects? The advantage with a heap-allocated object is that it exists or not. Sticking something on the stack has advantages, is the intent here to allow the creation of stack objects with these properties, because it seems like Maybe<> or something Maybe<>-like is the best choice there, maybe (hah) following the same pattern. > - I suspect that in some heap-allocated objects it will be hard to do > the fallible parts without having an object of the relevant type. I > don't have specific examples, just a hunch. I'm not aware of any way that necessary state can't be fully established before constructing an object. If you find a way in which this is possible, please let me know. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform