Compiler warning when class breaks rule three (five)

Is it possible to trigger a compiler warning when a class breaks rule three (or rule five)?

This feature sounds easy to implement and very useful in security-critical software, but I can't find it anywhere in Google docs or search results.

+5
source share
2 answers

You can use the compiler flag - Weff ++ for GCC

+5
source

Visual Studio 2017 RC points out to have some "Checkers to enforce C ++ basic principles." Since the Rule of Five is one of the most easily verified rules, I believe that it is implemented.

+1
source

Source: https://habr.com/ru/post/1260925/


All Articles