Kiedy trawa była bardziej zielona

 

25

11

2008

Ciekawy przełącznik w g++

Natrafiłem niedawno na nowy przełącznik w g++: mianowicie -Weffc++, który włącza sprawdzanie zgodności z dobrym stylem wg. Scotta Meyersa w „Effective C++”.

MAN do g++ podaje:

Warn about violations of the following guidelines from Scott Meyer’s "Effective C++" book:

  • Item 11: Define a copy constructor and an assignment operator for classes with dynamically allocated memory.
  • Item 12: Prefer initialization to assignment in constructors.
  • Item 14: Make destructors virtual in base classes.
  • Item 15: Have operator= return a reference to *this.
  • Item 23: Don’t try to return a reference when you must return an object.

Also warn about violations of the following style guidelines from Scott Meyers’ "More Effective C++" book:

  • Item 6: Distinguish between prefix and postfix forms of increment and decrement operators.
  • Item 7: Never overload &&, ||, or ,.

Jedni pewnie znają, inni nie.

 
 

Komentarze

 
 
 

№ 1

2008 11 25, 18:37:37

odrzut

o :) fajne, dzięki

 
 
 

№ 2

2008 12 25, 16:40:34

brtk

Ciekawe, mam nawet wersję elektroniczną tej książki, a jeszcze do niej nie zaglądałem ;-P

 
 
 

Dodaj komentarz

 

Podpis

 

URL

 

Treść

 
 
 
 

Miniblog