Date: Mon, 1 Jul 2024 23:32:48 +0800
On this page <URL:https://en.cppreference.com/w/cpp/container/vector/vector>,
I saw the wording "Move constructor. Constructs the container with the
contents of other using move semantics.... After the move, other is
guaranteed to be empty()."
Does the standard really provide this empty() guarantee (for vector,
or any other containers)? I cannot find it. I only see the general
specification that a moved-from object is in a valid but unspecified
state.
(If it does not provide this guarantee, should it?)
I saw the wording "Move constructor. Constructs the container with the
contents of other using move semantics.... After the move, other is
guaranteed to be empty()."
Does the standard really provide this empty() guarantee (for vector,
or any other containers)? I cannot find it. I only see the general
specification that a moved-from object is in a valid but unspecified
state.
(If it does not provide this guarantee, should it?)
-- Yongwei Wu URL: http://wyw.dcweb.cn/
Received on 2024-07-01 15:33:06