[PATCH] Add gdb::nullopt, from C++17's std::nullopt

Simon Marchi simark@simark.ca
Tue May 19 19:15:34 GMT 2020


On 2020-05-19 2:55 p.m., cbiesinger--- via Gdb-patches wrote:
> diff --git a/gdbsupport/gdb_optional.h b/gdbsupport/gdb_optional.h
> index 02a87f6ee4..d1e70e4be9 100644
> --- a/gdbsupport/gdb_optional.h
> +++ b/gdbsupport/gdb_optional.h
> @@ -25,12 +25,17 @@
>  namespace gdb
>  {
>  
> +struct nullopt_t {
> +    explicit constexpr nullopt_t (int) {}
> +};

Formatting of curly braces.

And as mentioned on IRC, there are probably tests in gdb/unittests/optional we can
enable for nullopt.

Simon


More information about the Gdb-patches mailing list