コード例 #1
0
ファイル: vec_GF2.cpp プロジェクト: tell/ntl-unix
void vec_GF2::move(vec_GF2& y)  
{
   // special logic to get exception handling right
   if (&y == this) return;
   if (fixed() || y.fixed()) LogicError("move: can't move these vectors");

   vec_GF2 tmp;
   tmp.swap(y);
   tmp.swap(*this);
}
コード例 #2
0
void vec_GF2::swap(vec_GF2& y)
{
   long xf = fixed();
   long yf = y.fixed();

   if (xf != yf || (xf && length() != y.length()))
      LogicError("swap: can't swap these vec_GF2s");

   rep.swap(y.rep);
   _ntl_swap(_len, y._len);
   _ntl_swap(_maxlen, y._maxlen);
}