C++ Logo

std-discussion

Advanced search

const-correctness - deleting const move constructor X(const X&&)

From: Smith, Jim <jim.smith_at_[hidden]>
Date: Fri, 16 Feb 2024 21:22:07 +0000
Hi All,

Deleting the const move constructor X(const&&) results in the default non-const move constructor also being deleted. A const move constructor doesn't seem logical or maybe I'm missing something about the move feature in general.

In the above is the not explicit deletion of the default non-const move constructor backed by the standard?
I see in the standard under 'Copy/move constructors' 11.4.5.3 it says "X(const X&&) // OK, but possibly not sensible" so I'm concerned about it being used this way.

--James S

Received on 2024-02-16 21:22:35