void swap()

in fboss/cli/fboss2/tabulate/variant_lite.hpp [1530:1582]


  void swap(variant &other)
#if variant_CPP11_OR_GREATER
      noexcept(
          std::is_nothrow_move_constructible<T0>::value &&std17::is_nothrow_swappable<
              T0>::value &&std::is_nothrow_move_constructible<T1>::value
              &&std17::is_nothrow_swappable<T1>::value &&std::is_nothrow_move_constructible<
                  T2>::value &&std17::is_nothrow_swappable<T2>::value
                  &&std::is_nothrow_move_constructible<T3>::value &&std17::is_nothrow_swappable<
                      T3>::value &&std::is_nothrow_move_constructible<T4>::value
                      &&std17::is_nothrow_swappable<T4>::value &&std::is_nothrow_move_constructible<
                          T5>::value &&std17::is_nothrow_swappable<T5>::value &&std::
                          is_nothrow_move_constructible<T6>::value &&std17::is_nothrow_swappable<
                              T6>::value &&std::is_nothrow_move_constructible<T7>::value &&std17::
                              is_nothrow_swappable<T7>::value &&std::is_nothrow_move_constructible<
                                  T8>::value &&std17::is_nothrow_swappable<T8>::value
                                  &&std::is_nothrow_move_constructible<
                                      T9>::value &&std17::is_nothrow_swappable<T9>::value
                                      &&std::is_nothrow_move_constructible<
                                          T10>::value &&std17::is_nothrow_swappable<T10>::value
                                          &&std::is_nothrow_move_constructible<
                                              T11>::value &&std17::is_nothrow_swappable<T11>::value
                                              &&std::is_nothrow_move_constructible<T12>::value
                                                  &&std17::is_nothrow_swappable<T12>::value &&
                                                      std::is_nothrow_move_constructible<T13>::value
                                                          &&std17::is_nothrow_swappable<T13>::value
                                                              &&std::is_nothrow_move_constructible<
                                                                  T14>::value
                                                                  &&std17::is_nothrow_swappable<
                                                                      T14>::value &&std::
                                                                      is_nothrow_move_constructible<
                                                                          T15>::value &&std17::
                                                                          is_nothrow_swappable<
                                                                              T15>::value

      )
#endif
  {
    if (valueless_by_exception() && other.valueless_by_exception()) {
      // no effect
    } else if (type_index == other.type_index) {
      this->swap_value(type_index, other);
    } else {
#if variant_CPP11_OR_GREATER
      variant tmp(std::move(*this));
      *this = std::move(other);
      other = std::move(tmp);
#else
      variant tmp(*this);
      *this = other;
      other = tmp;
#endif
    }
  }