intuitive C++ (not)
You have to take special measures to copy a simple object because... part of it is constant. How... deeply... intuitive? Bjarne Stroustrup, you have created a monstrosity!
CA.cpp:114:5: error: object of type 'BitVector' cannot be assigned because its copy assignment operator is implicitly deleted b = unpack(); ^ ./BitVector.h:19:15: note: copy assignment operator of 'BitVector' is implicitly deleted because field 'numWords' is of const-qualified type 'const sizet' (aka 'const unsigned long') const sizet numWords; // set on initialization ^ 1 error generated.
I call it duke typing: If it looks like a duke and talks like a duke—fuggedaboutit, there’s no nobility in this code.
Kudos to clang
for clearly explaining the poor design decisions of C++.
Comments