this post was submitted on 18 Jun 2023
12 points (100.0% liked)

C++

1732 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 1 year ago (2 children)

What can you do? Declare the move constructor, but don’t implement it.

This sounds like a solution that warrants a big huge comment or the next guy to refactor will remove it and break stuff...

[–] [email protected] 4 points 1 year ago (1 children)

That's how we would have to do non-copyable classes before C++11. Older code bases are still filled with unimplemented copy constructors and assignment operators with comments. If you were extra thorough they'd also be private. PC Lint hated both of those tactics.

[–] AlmightySnoo 1 points 1 year ago* (last edited 1 year ago)

PC Lint

PC-Lint is an abomination that belongs in the depths of hell anyway, it struggles a lot with modern C++/TMP.

[–] [email protected] 3 points 1 year ago

This is actually what I did. I declared it and left a comment to explain why it needed to be left unimplemented.