Advertisement
Centril

c++ centril style

Oct 29th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. template<...>
  2. class some_stupid_class {
  3. public:
  4.     int retarded_variable,
  5.         of_same_type;
  6.  
  7.     float my_stupid_float;
  8.  
  9.     static const int THIS_BE_CONSTANT = 1337;
  10.  
  11. private:
  12.     do_crazy_shit() {
  13.         if ( this->retarded_variable == 1 ) {
  14.             // Comments always begin with capitalized letter and end with punctuation.
  15.             int a = this->other_method( 1, 2 );
  16.  
  17.             // Short ternary.
  18.             int c = true ? 1 : 2;
  19.  
  20.             // Long ternary.
  21.             int b = 1 == 2 && 3 == 4 || 3 == 5
  22.                   ? another_long_method()
  23.                   : 0;
  24.         }
  25.  
  26.         int x = 0;
  27.         for ( int i = 0; i < 100; ++i ) {
  28.             x += 1;
  29.         }
  30.  
  31.         {
  32.             bar();
  33.         }
  34.     }
  35.  
  36.     int other_method( int arg1, int arg2 ) {
  37.         return 1337;
  38.     }
  39.        
  40. func1() {
  41.    
  42.     foo(); // Above line kept blank for clarity.
  43.     bar();
  44.  
  45.     if(i < 0) {
  46.         i++;
  47.     }
  48.  
  49.     {
  50.         // This is an anonymous block.
  51.         bar();
  52.     }
  53.  
  54.     return;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement