From 2e59c78e0c12f639c3334450509b5f158c9ce38e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 7 Feb 2022 13:11:43 +0300 Subject: Add constructor for dependency_alternative class --- libbpkg/manifest.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index 364255b..6428e3a 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -561,6 +561,22 @@ namespace bpkg accept (std::move (a)), require (std::move (q)) {} + // Can be used to copy a dependency alternative object, while omitting + // some clauses which are no longer needed. + // + dependency_alternative (butl::optional e, + butl::optional r, + butl::optional p, + butl::optional a, + butl::optional q, + butl::small_vector ds) + : small_vector (move (ds)), + enable (std::move (e)), + reflect (std::move (r)), + prefer (std::move (p)), + accept (std::move (a)), + require (std::move (q)) {} + // Return the single-line representation if possible (the prefer and // require clauses are absent and the reflect clause either absent or // contains no newlines). -- cgit v1.1