This makes a moved BlockVector have the right post-condition, i.e.
the state it would have after default construction.
* @note This constructor is only available if deal.II is configured with
* C++11 support.
*/
- BlockVector (BlockVector<Number> &&v);
+ BlockVector (BlockVector<Number> &&v) = default;
#endif
* @note This operator is only available if deal.II is configured with C++11
* support.
*/
- BlockVector<Number> &operator= (BlockVector<Number> &&v);
+ BlockVector<Number> &operator= (BlockVector<Number> &&v) = default;
#endif
/**
-#ifdef DEAL_II_WITH_CXX11
-template <typename Number>
-inline
-BlockVector<Number> &
-BlockVector<Number>::operator= (BlockVector<Number> &&v)
-{
- swap(v);
-
- return *this;
-}
-#endif
-
-
-
template <typename Number>
inline
BlockVector<Number> &
}
-#ifdef DEAL_II_WITH_CXX11
-template <typename Number>
-BlockVector<Number>::BlockVector (BlockVector<Number> &&v)
- :
- BlockVectorBase<Vector<Number> > ()
-{
- swap(v);
-}
-#endif
-
-
#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
template <typename Number>
*/
BlockVectorBase ();
+#ifdef DEAL_II_WITH_CXX11
+ /**
+ * Copy constructor.
+ */
+ BlockVectorBase (const BlockVectorBase &V) = default;
+
+ /**
+ * Move constructor. Each block of the vector @p V is moved into the current
+ * object if the underlying <code>VectorType</code> is move-constructible,
+ * otherwise they are copied.
+ *
+ * @note This constructor is only available if deal.II is configured with
+ * C++11 support.
+ */
+ BlockVectorBase (BlockVectorBase &&V) = default;
+#endif
+
/**
* Update internal structures after resizing vectors. Whenever you reinited
* a block of a block vector, the internal data structures are corrupted.
BlockVectorBase &
operator= (const BlockVectorBase &V);
+#ifdef DEAL_II_WITH_CXX11
+ /**
+ * Move assignment operator. Move each block of the vector @p V into the
+ * current object if `VectorType` is move-constructible, otherwise copy them.
+ */
+ BlockVectorBase &operator= (BlockVectorBase &&V) = default;
+#endif
+
/**
* Copy operator for template arguments of different types.
*/
} //namespace internal
+
template <class VectorType>
inline
BlockVectorBase<VectorType>::BlockVectorBase ()
DEAL::[block 2 ] 20.0000 21.0000
DEAL::[block 3 ] 30.0000 31.0000
DEAL::[block 4 ] 40.0000 41.0000
-DEAL::old object size: 5
+DEAL::old object size: 0
DEAL::Block vector: move assignemnt:
DEAL::[block 0 ] 0.00000 1.00000
DEAL::[block 1 ] 10.0000 11.0000