// file : tests/optional/driver.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file #include #include #include // move(), pair #include #undef NDEBUG #include using namespace std; struct move_only { move_only () = default; move_only (move_only&&) = default; move_only& operator= (move_only&&) = default; move_only (const move_only&) = delete; move_only& operator= (const move_only&) = delete; }; int main () { using butl::optional; { optional r; vector> rs; rs.emplace_back (move (r)); } // See https://github.com/libstud/libstud-optional/issues/1 for details. // #if 0 { vector>> options; auto add = [&options] (string o, optional v = {}) { options.emplace_back (move (o), move (v)); }; add ("-usb"); add ("-device", "usb-kbd"); } #endif }