archive by month
Skip to content

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++.

Trackbacks

No Trackbacks

Comments

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options

Submitted comments will be subject to moderation before being displayed.