Пример #1
0
 /**
  * Resize the storage appropriately.
  * @param n hint for the new table size.
  */
 void rehash(size_t n = 1) {
     MyHashTable tmp(std::max(tableSize_, n), hashFunc, eqFunc);
     for (iterator t = begin(); t != end(); ++t) {
         tmp.add(*t);
     }
     moveAssign(tmp);
 }
Пример #2
0
Variant<Type, Types...> &Variant<Type, Types...>::
operator=(Variant &&rhs) noexcept(
    AllIs<std::is_nothrow_move_assignable, Type, Types...>::value) {
  static_assert(
      AllIs<std::is_nothrow_move_constructible, Type, Types...>::value,
      "AllIs types must be nothrow move-constructible to use copy assignment");

  if (m_typeIndex == rhs.m_typeIndex) {
    moveAssign(m_typeIndex, &m_storage, &rhs.m_storage);
  } else {
    destroy(m_typeIndex, &m_storage);
    m_typeIndex = rhs.m_typeIndex;
    move(m_typeIndex, &m_storage, &rhs.m_storage);
  }

  return *this;
}
Пример #3
0
Model& Model::operator= (Model&& m)
{
    free();
    moveAssign(std::move(m));
}
Пример #4
0
Model::Model(Model&& m)
{
    moveAssign(std::move(m));
}