[PATCH] Move optional into the experimental namespace (first bit of the TSes)

Richard Smith richard at metafoo.co.uk
Tue Nov 12 15:33:44 PST 2013


I assume the intent is to implement this paper:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3793.html

So, assuming that include/experimental/optional was copied from
include/optional (the diff doesn't say where the 'old' lines come from
here)...

You included the inline namespace in the library synopsis comment; it
shouldn't be there.

bad_optional_access should be in namespace std::experimental, not in
namespace std.

For headers in include/support, the source files are in src/support. Should
optional.cpp be moved to src/experimental/optional.cpp?

Bikeshedding on the name __TSLibraryFundamentals:
 * Should this contain a version number? We may want an ABI break at some
point, and it might be nicer to have always had the version number in the
name.
 * Other library-internal names in libc++ seem to use __lower_case_names
Maybe __library_fundamentals_1?

Somewhat related to versioning, do we want to provide some way for people
to opt into/out of individual TSes? For instance, I might want to test that
my code compiles as standard C++14 (with no TSes), or to use the
fundamentals TS but not the filesystem TS, since the latter has security
issues.

How will we handle TSes that affect existing headers, rather than adding
new ones? (Do we have any of those yet?) How will we handle TSes that need
both frontend and library changes, such as the array extensions TS? It
might be nice to have a single flag to the compiler ("-fsomething" or
"-std=c++14+fundamentals+arrays" or something) to enable TSes for language
and library as appropriate. Any ideas?

On Tue, Nov 12, 2013 at 1:48 PM, Marshall Clow <mclow.lists at gmail.com>wrote:

> Along with C++14, the standard committee is working on several "Technical
> Specifications", designed to bring features that for one reason or another
> weren't able to be in C++14 to people before the next version of the
> standard (C++17??).  Those of you who remember TR1 (from about 2005) - this
> is a similar process under a new name.
>
> There are several being worked on:
>         * Library Fundamentals
>         * Arrays of Runtime Bound
>         * Networking
>         * Concepts
>         * Filesystem
>
> This patch takes the implementation of <optional> that Howard wrote and
> committed into libc++ (before the committee removed the feature from
> C++14), and moves it into the new "experimental" area, which is where these
> TSes will live until they are enshrined in a future version of the standard.
>
> That area can be described as:
>         namespace std::experimental (feel free to alias this to something
> shorter in your code)
>         files live in the "experimental/" directory.
>
> If you're already using the <optional> in libc++, you'll have to change
> your code to:
>         #include <experimental/optional>
> and
>         std::experimental::optional<T>
>
> It's a big patch, but it's just renaming things; if I actually changed
> some code, then I did it wrong.
>
> -- Marshall
>
> Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>
>
> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is
> promptly moderated down to (-1, Flamebait).
>         -- Yu Suzuki
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131112/8303bcec/attachment.html>


More information about the cfe-commits mailing list