
On Wed, May 4, 2011 at 1:04 PM, Olaf van der Spek <ml@vdspek.org> wrote:
On Wed, May 4, 2011 at 12:50 PM, Robert Jones <robertgbjones@gmail.com> wrote:
On Wed, May 4, 2011 at 11:33 AM, Olaf van der Spek <ml@vdspek.org> wrote:
On Tue, May 3, 2011 at 8:52 PM, Olaf van der Spek <ml@vdspek.org> wrote:
On Tue, May 3, 2011 at 6:57 PM, Robert Jones <robertgbjones@gmail.com> wrote:
I'd prefer to see it return a boost::optional<T&>
What's the benefit?
Simply that the difficulty you're addressing is the possibility that
On Wed, May 4, 2011 at 9:37 AM, Robert Jones <robertgbjones@gmail.com> wrote: there's
no value to return. Boost.optional expresses that directly.
Returning NULL works just as well. Using a raw pointer also allows you to write string* ptr = find_ptr(). Using Boost Optional would make that longer.
You'd have to write optional<string> s = find_ptr(); //Now misnamed of course!
boost::optional Shouldn't it be string&?
Either way, at some point you'd have to check the value was usable before using it.
Sure, but that can be done just as well with a pointer. Boost Optional is targeted at functions that return by value.
What's the best way to get this wrapper into Boost?
Somebody? Please? Olaf