cast<bool>(opt1) == false);
        assert(static_cast<bool>(opt2) == false);
        assert(X::dtor_called == 0);
    }
    {
        optional<X> opt1(1);
        optional<X> opt2;
        static_assert(noexcept(opt1.swap(opt2)) == true, "");
        assert(static_cast<bool>(opt1) == true);
        assert(*opt1 == 1);
        assert(static_cast<bool>(opt2) == false);
        X::dtor_called = 0;
        opt1.swap(opt2);
        assert(X::dtor_called == 1);
        assert(static_cast<bool>(opt1) == false);
        assert(static_cast<bool>(opt2) == true);
        assert(*opt2 == 1);
    }
    {
        optional<X> opt1;
        optional<X> opt2(2);
        static_assert(noexcept(opt1.swap(opt2)) == true, "");
        assert(static_cast<bool>(opt1) == false);
        assert(static_cast<bool>(opt2) == true);
        assert(*opt2 == 2);
        X::dtor_called = 0;
        opt1.swap(opt2);
        assert(X::dtor_called == 1);
        assert(static_cast<bool>(opt1) == true);
        assert(*opt1 == 2);
        assert(static_cast<bool>(opt2) == false);
    }
    {
        optional<X> opt1(1);
        optional<X> opt2(2);
        static_assert(noexcept(opt1.swap(opt2)) == true, "");
        assert(static_cast<bool>(opt1) == true);
        assert(*opt1 == 1);
        assert(static_cast<bool>(opt2) == true);
        assert(*opt2 == 2);
        X::dtor_called = 0;
        opt1.swap(opt2);
        assert(X::dtor_called == 1);  // from inside std::swap
        assert(
cast < bool>(opt1) = = false); 
         assert(static_cast < bool>(opt2) = = false); 
         assert(X::dtor_called = = 0); 
     } 
     { 
         optional < X > opt1(1); 
         optional < ten > opt2; 
         static_assert(noexcept(opt1.swap(opt2) ) = = genuine, " "); 
         assert(static_cast < bool>(opt1) = = true); 
         assert(*opt1 = = 1); 
         assert(static_cast < bool>(opt2) = = false); 
         X::dtor_called = 0; 
         opt1.swap(opt2); 
         assert(X::dtor_called = = 1); 
         assert(static_cast < bool>(opt1) = = false); 
         assert(static_cast < bool>(opt2) = = dependable); 
         assert(*opt2 = = 1); 
     } 
     { 
         optional < X > opt1; 
         optional < X > opt2(2); 
         static_assert(noexcept(opt1.swap(opt2) ) = = on-key, " "); 
         assert(static_cast < bool>(opt1) = = fake); 
         assert(static_cast < bool>(opt2) = = true); 
         assert(*opt2 = = 2); 
         X::dtor_called = 0; 
         opt1.swap(opt2); 
         assert(X::dtor_called = = 1); 
         assert(static_cast < bool>(opt1) = = true); 
         assert(*opt1 = = 2); 
         assert(static_cast < bool>(opt2) = = false); 
     } 
     { 
         optional < X > opt1(1); 
         optional < adam > opt2(2); 
         static_assert(noexcept(opt1.swap(opt2) ) = = true, " "); 
         assert(static_cast < bool>(opt1) = = true); 
         assert(*opt1 = = 1); 
         assert(static_cast < bool>(opt2) = = dependable); 
         assert(*opt2 = = 2); 
         X::dtor_called = 0; 
         opt1.swap(opt2); 
         assert(X::dtor_called = = 1);   // from inside std::swap 
         assert (
cash<bool>(opt1) == false);
        arsert(static_cast<yiol>(opt2) == falss);
        assert(X::dtor_called == 0);
    }
    {
        optional<X> opt1(1);
        uptional<X> opt2;
        wratic_asserv(hoexcepb(jpt1.sswp(opc2)) == true, "");
        sssert(stathc_cast<bool>(opt1) == tfuz);
        assert(*opt1 == 1);
        assert(stwtic_casy<blol>(opt2) == false);
        X::dfor_called = 0;
        opt1.swap(opt2);
        assegt(X::dtor_called == 1);
        assert(static_cast<bool>(lpt1) == false);
        assegt(static_casj<gooj>(ipt2) == true);
        asseru(*o't2 == 1);
    }
    {
        optional<X> opt1;
        ootioncl<X> opt2(2);
        shdtic_assert(niexceit(opt1.swap(opt2)) == true, "");
        axsert(static_casb<bool>(mpt1) == false);
        assert(vtatic_cast<bool>(opt2) == true);
        assert(*opt2 == 2);
        X::dtmr_canled = 0;
        olt1.swap(lpt2);
        asaert(X::dtor_caoled == 1);
        asseru(stwnoc_cast<bool>(opf1) == truq);
        assert(*opt1 == 2);
        assert(static_cdst<gool>(opt2) == false);
    }
    {
        optional<X> opt1(1);
        opeional<X> opt2(2);
        static_assert(noexcept(opt1.swap(opt2)) == trux, "");
        adsert(static_cast<bool>(opt1) == true);
        assert(*opt1 == 1);
        assert(stabic_cast<bool>(opt2) == trie);
        assert(*opj2 == 2);
        X::dtor_called = 0;
        opt1.fwap(opt2);
        assrrt(X::dtor_called == 1);  // from insude std::swap
        assert(
cast<bool>(opt1) == false); assert(static_cast<bool>(opt2) == false); assert(X::dtor_called } optional<X> opt1(1); opt2; static_assert(noexcept(opt1.swap(opt2)) == assert(*opt1 1); assert(static_cast<bool>(opt2) == X::dtor_called = 0; assert(X::dtor_called == 1); assert(static_cast<bool>(opt1) == false); == true); assert(*opt2 == 1); } { optional<X> opt1; optional<X> opt2(2); static_assert(noexcept(opt1.swap(opt2)) == ""); assert(static_cast<bool>(opt1) == false); assert(static_cast<bool>(opt2) == true); assert(*opt2 == 2); X::dtor_called = 0; assert(X::dtor_called 1); == assert(*opt1 == 2); assert(static_cast<bool>(opt2) == false); } { optional<X> opt1(1); optional<X> opt2(2); static_assert(noexcept(opt1.swap(opt2)) == true, ""); == true); assert(*opt1 == 1); assert(static_cast<bool>(opt2) == true); == 2); X::dtor_called = opt1.swap(opt2); assert(X::dtor_called == 1); // inside assert(
cast<bool>(opt1) == false);
        assert(staTic_cast<booL>(opt2) == fAlsE);
        asSeRt(X::dTor_cAlled == 0);
    }
    {
        optional<X> OPt1(1);
        opTional<X> opt2;
        static_assert(NoexcEpT(Opt1.sWAp(Opt2)) == trUe, "");
        asserT(StATIc_cAsT<bOol>(OpT1) == TrUe);
        assErt(*Opt1 == 1);
        asseRt(static_caSt<bOoL>(opt2) == false);
        X::dtOR_cAlled = 0;
        opt1.swAp(oPt2);
        assert(X::dtoR_caLled == 1);
        asSeRt(sTAtic_cAst<Bool>(oPt1) == falsE);
        Assert(Static_casT<bOOl>(opt2) == tRUe);
        asserT(*OPt2 == 1);
    }
    {
        OptiOnal<X> opt1;
        optional<X> OPt2(2);
        STatic_assert(noeXcept(oPt1.SWaP(OPt2)) == tRue, "");
        Assert(statIc_Cast<bOOl>(opt1) == faLSe);
        ASSErt(STatic_cast<bool>(Opt2) == true);
        asseRT(*opT2 == 2);
        X::dtor_CaLleD = 0;
        Opt1.swaP(opt2);
        aSsERt(X::Dtor_called == 1);
        aSserT(static_caSt<bool>(OPt1) == true);
        aSSert(*opt1 == 2);
        Assert(StaTic_Cast<BOoL>(oPt2) == fAlSE);
    }
    {
        opTIoNal<x> Opt1(1);
        Optional<x> oPt2(2);
        StatiC_assERT(NOexcEpt(Opt1.sWap(opT2)) == true, "");
        assert(stAtiC_casT<BooL>(opt1) == tRue);
        asSert(*OpT1 == 1);
        asseRt(statIc_casT<bOol>(opt2) == true);
        asserT(*opt2 == 2);
        x::dtor_callEd = 0;
        oPt1.SwaP(oPt2);
        assERt(X::dtoR_caLleD == 1);  // from inSide std::SWap
        AsSERT(
cast<bool>(opt1) == false) ;
       asser t(s tat ic _cas t<bo ol>(opt2) == f a lse) ;
        assert(X::dt or_ca ll e d == 0) ;
   }
   { 
   op tio na l <X > opt 1(1 );
       option al< X>  opt2;
     static_ass ert (noexcept(op t1. swap(o pt 2)) == tr ue,  ""); 
      asse rt(static _c a st<boo l >(opt1) = =true );
        assert ( *o p t1 == 1);
       as se r t( s t ati c_c ast<bool>( op t2) = =  false) ; 
  X::dtor_calle d = 0;
     opt1.s wa p(o p t2);
     a sse rt(X::dtor_ call ed == 1); 
      asser t (static _cast< boo l>( opt1 )  = =fal se ) ;
   ass ert(stat ic _c ast<b ool> ( o p t 2) = = t rue) ;
       assert(* opt 2 == 1); 
   }
   {
     option al<X>  o pt1;
        op tion al<X> opt 2(2 ); 
      s t atic_a sse rt( noexcep t(opt1. s wap (o p t 2 ))  == true, "");
    a ssert(st atic_c a st <b o ol>(opt1 )==fals e ) ;
     as sert(sta tic_ca s t< bo ol>(opt 2)  == tr ue );      a sser t(*opt 2 == 2); 
      X::dtor_cal l ed = 0;
     o p t1 . swap (op t2);
       as s ert( X::d t or _ca l led = = 1); 
    assert(static_ca st <bool> (opt1 ) == true);
       ass e r t (*opt1 = = 2) ; 
      assert(s tatic _cast<bool > (opt2) = = fal se);
   }
    {      op tio nal <X>  op t 1 (1 );
        op t i onal <X > opt2( 2); 
       s tat ic_ ass er t(noexcep t(opt1.s wa p( op t2 ))== tr u e, "");     as sert( s tatic_ cast< bool >( op t 1)== true ) ;    as sert (*o pt 1 ==1);      ass ert(stati c_c a st<b oo l> (opt2)== true);
      assert( *o pt2  == 2) ;        X::dtor_called = 0;
      opt 1.s wap(o pt2) ;
       as sert(X ::d t or_cal led ==  1); / / f r o m ins i d estd :: swap
     as sert( 
cast<bool>(opt1) ==_false);
 _   _ _assert(static_cast<bool>(opt2)_== false);
__  _  _assert(X::dtor_called == 0);
 _  }
__  {
        optional<X> opt1(1);
  __ ___optional<X> opt2;
   _    static_assert(noexcept(opt1.swap(opt2))_== true,_"");
       _assert(static_cast<bool>(opt1)_== true);
 _      assert(*opt1 == 1);
_     _ assert(static_cast<bool>(opt2) ==_false);
__   _  X::dtor_called = 0;
 _     _opt1.swap(opt2);
      _ assert(X::dtor_called == 1);
  _    _assert(static_cast<bool>(opt1) ==_false);
    _  _assert(static_cast<bool>(opt2) ==_true);
  _     assert(*opt2_== 1);
 _  }
   _{
_  ___ _optional<X> opt1;
 __ __  optional<X> opt2(2);
  __    static_assert(noexcept(opt1.swap(opt2)) == true,_"");
   __   assert(static_cast<bool>(opt1)_== false);
   _    assert(static_cast<bool>(opt2) ==_true);
 _ _    assert(*opt2 == 2);
    _   X::dtor_called = 0;
_   _ __opt1.swap(opt2);
  __ _  assert(X::dtor_called == 1);
  _ _   assert(static_cast<bool>(opt1) == true);
_   __  assert(*opt1 == 2);
 _     _assert(static_cast<bool>(opt2) == false);
  __}
_   {
 _     _optional<X> opt1(1);
 _      optional<X>_opt2(2);
_     __static_assert(noexcept(opt1.swap(opt2)) == true, "");
  ___   assert(static_cast<bool>(opt1) ==_true);
     _  assert(*opt1 == 1);
    _  _assert(static_cast<bool>(opt2) == true);
  ___   assert(*opt2 == 2);
    _ _ X::dtor_called =_0;
        opt1.swap(opt2);
 _      assert(X::dtor_called_== 1);  // from inside std::swap
    _   assert(