mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
gdb: Replace gdb::optional with std::optional
Since GDB now requires C++17, we don't need the internally maintained gdb::optional implementation. This patch does the following replacing: - gdb::optional -> std::optional - gdb::in_place -> std::in_place - #include "gdbsupport/gdb_optional.h" -> #include <optional> This change has mostly been done automatically. One exception is gdbsupport/thread-pool.* which did not use the gdb:: prefix as it already lives in the gdb namespace. Change-Id: I19a92fa03e89637bab136c72e34fd351524f65e9 Approved-By: Tom Tromey <tom@tromey.com> Approved-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#include <sys/types.h>
|
||||
#include "gdbsupport/gdb_sys_time.h"
|
||||
#include "gdbsupport/gdb_select.h"
|
||||
#include "gdbsupport/gdb_optional.h"
|
||||
#include <optional>
|
||||
#include "gdbsupport/scope-exit.h"
|
||||
|
||||
/* See event-loop.h. */
|
||||
@@ -246,7 +246,7 @@ gdb_do_one_event (int mstimeout)
|
||||
When the timeout is reached, events are not monitored again:
|
||||
they already have been checked in the loop above. */
|
||||
|
||||
gdb::optional<int> timer_id;
|
||||
std::optional<int> timer_id;
|
||||
|
||||
SCOPE_EXIT
|
||||
{
|
||||
@@ -258,7 +258,7 @@ gdb_do_one_event (int mstimeout)
|
||||
timer_id = create_timer (mstimeout,
|
||||
[] (gdb_client_data arg)
|
||||
{
|
||||
((gdb::optional<int> *) arg)->reset ();
|
||||
((std::optional<int> *) arg)->reset ();
|
||||
},
|
||||
&timer_id);
|
||||
return gdb_wait_for_event (1);
|
||||
|
||||
Reference in New Issue
Block a user