Show HN: Modifying Clang for a Safer, More Explicit C++
I think you might be onto something with regards to the general idea, but most of your particular rules I disagree with. vector&lt;mutable int&gt; for example is very strange; there&#x27;s no reason vector&lt;int&gt; shouldn&#x27;t work. With respect to lambda captures always being explicit, it&#x27;s a far heavier restriction than you (and many) people realize—sometimes you literally cannot know what&#x27;s inside the lambda to be able to capture it (look up the SCOPE_EXIT macro as just one example), and even when you can, listing all of them is <i>sometimes</i> far more harmful to readability than helpful—it depends strongly on the situation. Goto is absolutely necessary in certain rare but practical cases too—like when converting a recursive algorithm to an iterative one without breaking git blame. C-style casts to (void) are pretty useful, so you&#x27;d need at least an exception for that.<p>Constructors being explicit by default I 100% agree with, and there are other rules I could come up with too, but in general, you need to realize that a lot of the features in the language have legitimate use cases that you might simply have a hard time imagining. Therefore, coming up with useful rules without hampering useful functionality requires both (a) experience &amp; playing around with the language to a greater extent than you might at your job, and (b) a <i>great</i> deal of thought on top of that.