From d6be3b97cc3ce723ca3b2372c893b41aec16a9a4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2015 15:39:50 +0200 Subject: Use nullopt to reset optional --- bpkg/pkg-disfigure.cxx | 2 +- bpkg/pkg-fetch.cxx | 4 ++-- bpkg/pkg-purge.cxx | 4 ++-- bpkg/pkg-unpack.cxx | 6 +++--- bpkg/types | 1 + 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bpkg/pkg-disfigure.cxx b/bpkg/pkg-disfigure.cxx index d9ed811..48e54ba 100644 --- a/bpkg/pkg-disfigure.cxx +++ b/bpkg/pkg-disfigure.cxx @@ -82,7 +82,7 @@ namespace bpkg throw; } - p->out_root = optional (); + p->out_root = nullopt; p->state = state::unpacked; db.update (p); diff --git a/bpkg/pkg-fetch.cxx b/bpkg/pkg-fetch.cxx index 1e7072c..a5d216b 100644 --- a/bpkg/pkg-fetch.cxx +++ b/bpkg/pkg-fetch.cxx @@ -109,9 +109,9 @@ namespace bpkg state::fetched, move (a), purge, - optional (), // No source directory yet. + nullopt, // No source directory yet. false, - optional () // No output directory yet. + nullopt // No output directory yet. }); db.persist (p); diff --git a/bpkg/pkg-purge.cxx b/bpkg/pkg-purge.cxx index 57e098d..7663dea 100644 --- a/bpkg/pkg-purge.cxx +++ b/bpkg/pkg-purge.cxx @@ -89,7 +89,7 @@ namespace bpkg if (exists (d)) // Don't complain if someone did our job for us. rm_r (d); - p->src_root = optional (); + p->src_root = nullopt; p->purge_src = false; } catch (const failed&) @@ -140,7 +140,7 @@ namespace bpkg if (exists (a)) rm (a); - p->archive = optional (); + p->archive = nullopt; p->purge_archive = false; } catch (const failed&) diff --git a/bpkg/pkg-unpack.cxx b/bpkg/pkg-unpack.cxx index f78543e..6979842 100644 --- a/bpkg/pkg-unpack.cxx +++ b/bpkg/pkg-unpack.cxx @@ -65,11 +65,11 @@ namespace bpkg move (m.name), move (m.version), state::unpacked, - optional (), // No archive - false, // Don't purge archive. + nullopt, // No archive + false, // Don't purge archive. move (ad), purge, - optional () // No output directory yet. + nullopt // No output directory yet. }); db.persist (p); diff --git a/bpkg/types b/bpkg/types index a5fe114..648c0f1 100644 --- a/bpkg/types +++ b/bpkg/types @@ -25,6 +25,7 @@ namespace bpkg using std::shared_ptr; using butl::optional; + using butl::nullopt; // // -- cgit v1.1