geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Barrett <jbarr...@pivotal.io>
Subject Re: Discussion: Native PDX Reader/Writer std::string
Date Tue, 19 Dec 2017 22:30:20 GMT
On Tue, Dec 19, 2017 at 1:52 PM Michael William Dodge <mdodge@pivotal.io>
wrote:

> Of those, #1 seems better than #2 and #3. Is there an elegant way to use a
> sentinel value of std::string to represent null, e.g., static const
> PdxReader::NULL_STRING = <magic happens here>?
>

I am absolutely opposed to sentinel values just from the standpoint that
once you pick a value someone will want that value.

The C++17 solution to this problem is std::optional<std::string>, but
unfortunately C++11 is our minimum. We could embrace boost::optional (for
which C++17 std::optional derives), but this will cause clients to also
depend on boost, which isn't ideal. We could roll our own optional...

-Jake

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message