Browse Source

Install clang-format

Sam Jaffe 6 years ago
parent
commit
8783e5d955

+ 108 - 0
.clang-format

@@ -0,0 +1,108 @@
+---
+Language:        Cpp
+# BasedOnStyle:  LLVM
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Right
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: true
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:   
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeColon
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: true
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: false
+ForEachMacros:   
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IncludeCategories: 
+  - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
+    Priority:        2
+  - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
+    Priority:        3
+  - Regex:           '.*'
+    Priority:        1
+IncludeIsMainRegex: '(Test)?$'
+IndentCaseLabels: false
+IndentWidth:     2
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: All
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 2
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Middle
+ReflowComments:  true
+SortIncludes:    true
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Cpp11
+TabWidth:        8
+UseTab:          Never
+...
+

+ 3 - 3
engine/include/game/engine/engine_fwd.hpp

@@ -14,16 +14,16 @@ namespace engine {
   using raw_key_t = int;
   using key_enum_t = int;
   using scene_id_t = std::string;
-  
+
   using key_binding = std::unordered_map<raw_key_t, key_enum_t>;
 
   class game_dispatch;
   class scene;
-  
+
   namespace event {
     struct key_event;
     struct mouse_event;
   }
-  
+
   struct tick;
 }

+ 10 - 10
engine/include/game/engine/events.hpp

@@ -25,24 +25,24 @@ namespace engine {
       QUIT
     };
   }
-  
+
   namespace event {
     enum event_type {
-      PRESSED_MASK   = 0x1,
-      RELEASED_MASK  = 0x2,
-      KEY_MASK       = 0x4,
-      MOUSE_MASK     = 0x8,
-      KEY_PRESSED    = KEY_MASK   | PRESSED_MASK ,
-      KEY_RELEASED   = KEY_MASK   | RELEASED_MASK,
-      MOUSE_PRESSED  = MOUSE_MASK | PRESSED_MASK ,
+      PRESSED_MASK = 0x1,
+      RELEASED_MASK = 0x2,
+      KEY_MASK = 0x4,
+      MOUSE_MASK = 0x8,
+      KEY_PRESSED = KEY_MASK | PRESSED_MASK,
+      KEY_RELEASED = KEY_MASK | RELEASED_MASK,
+      MOUSE_PRESSED = MOUSE_MASK | PRESSED_MASK,
       MOUSE_RELEASED = MOUSE_MASK | RELEASED_MASK
     };
-    
+
     struct key_event {
       key_enum_t key;
       event_type type;
     };
-    
+
     struct mouse_event {
       math::vec2 current_mouse_position;
       event_type type;

+ 19 - 18
engine/include/game/engine/game_dispatch.hpp

@@ -14,42 +14,43 @@
 #include "game/math/math_fwd.hpp"
 #include "vector/vector.hpp"
 
-#include "time.hpp"
 #include "engine_fwd.hpp"
 #include "events.hpp"
+#include "time.hpp"
 
 namespace engine {
   class game_dispatch {
   public:
-    game_dispatch( );
-    
-    void process_key_event( raw_key_t key, bool press );
-    void process_mouse_event( math::vec2 click, bool press );
-    
-    [[noreturn]] void gameloop( );
-    void quit( );
+    game_dispatch();
+
+    void process_key_event(raw_key_t key, bool press);
+    void process_mouse_event(math::vec2 click, bool press);
+
+    [[noreturn]] void gameloop();
+    void quit();
+
   private:
-    void single_frame( tick t ) { }
-    tick get_tick( );
-    tick next_frame( );
-    void cleanup_resources( ) { } // TODO ???
+    void single_frame(tick t) {}
+    tick get_tick();
+    tick next_frame();
+    void cleanup_resources() {} // TODO ???
   private:
     math::vec2 screen_size;
     duration minimum_frame_duration;
 
     using scene_t = std::unique_ptr<scene>;
     std::unordered_map<scene_id_t, scene_t> scenes;
-    
+
     bool running = true;
     timestamp current_timestamp;
     struct current_scene_info {
-      current_scene_info( );
-      current_scene_info( scene * );
-      
+      current_scene_info();
+      current_scene_info(scene *);
+
       scene * ptr; // weak
-      
+
       std::string current_scene_id; // metadata
-      math::vec2 local_size; // metadata
+      math::vec2 local_size;        // metadata
       bool is_mouse_event;
       bool is_keyboard_event;
     } curr_scene;

+ 14 - 12
engine/include/game/engine/scene.hpp

@@ -10,26 +10,28 @@
 #include <memory>
 
 #include "game/math/math_fwd.hpp"
-#include "vector/vector.hpp"
 #include "util/identity.hpp"
+#include "vector/vector.hpp"
 
 #include "engine_fwd.hpp"
 
-namespace engine {  
+namespace engine {
   class scene : public identity<scene, std::string> {
   public:
     using identity<scene, std::string>::identity;
-    virtual ~scene( );
-    
-    virtual void update( tick );
-    virtual void render( );
-    virtual void handle_key_event( event::key_event evt );
-    virtual void handle_mouse_event( event::mouse_event evt );
-    
-    math::vec2 get_size( ) const;
-    key_binding const & get_binding( ) const;
+    virtual ~scene();
+
+    virtual void update(tick);
+    virtual void render();
+    virtual void handle_key_event(event::key_event evt);
+    virtual void handle_mouse_event(event::mouse_event evt);
+
+    math::vec2 get_size() const;
+    key_binding const & get_binding() const;
+
   protected:
-    void change_scene( std::string const & scene_id );
+    void change_scene(std::string const & scene_id);
+
   private:
     math::vec2 local_scene_dimension;
     key_binding keys;

+ 3 - 3
engine/include/game/engine/time.hpp

@@ -13,7 +13,7 @@ namespace engine {
   using clock = std::chrono::steady_clock;
   using timestamp = std::chrono::time_point<clock>;
   using duration = clock::duration;
-  
+
   struct fps {
     static duration const v24;
     static duration const v30;
@@ -21,9 +21,9 @@ namespace engine {
     static duration const v120;
     static duration const v144;
   };
-  
+
   struct tick {
     timestamp now;
     duration since;
-  };  
+  };
 }

+ 52 - 65
engine/src/game_dispatch.cpp

@@ -14,80 +14,67 @@
 
 namespace engine {
   namespace {
-    event::event_type mask( event::event_type t, bool pressed ) {
-      return static_cast<event::event_type>( t | ( pressed ? event::PRESSED_MASK : event::RELEASED_MASK ) );
+    event::event_type mask(event::event_type t, bool pressed) {
+      return static_cast<event::event_type>(
+          t | (pressed ? event::PRESSED_MASK : event::RELEASED_MASK));
     }
   }
-  
-  game_dispatch::game_dispatch( )
-  : screen_size( { 1920.f, 1080.f } )
-  , minimum_frame_duration( engine::fps::v60 )
-  , scenes( )
-  , current_timestamp( clock::now( ) )
-  , curr_scene( ) {
-    
-  }
-  
-  game_dispatch::current_scene_info::current_scene_info( ) {
-    
-  }
-  
-  game_dispatch::current_scene_info::current_scene_info( scene * curr )
-  : ptr( curr )
-  , current_scene_id( ptr->id )
-  , local_size( ptr->get_size( ) ) {
-    
-  }
-  
-  void game_dispatch::process_key_event( raw_key_t key, bool press ) {
-    if ( ! curr_scene.is_keyboard_event ) return;
-    auto const & binding = curr_scene.ptr->get_binding( );
-    auto it = binding.find( key );
-    if ( it == binding.end( ) ) return;
-
-    curr_scene.ptr->handle_key_event( {
-      it->second,
-      mask( event::KEY_MASK, press )
-    } );
+
+  game_dispatch::game_dispatch()
+      : screen_size({1920.f, 1080.f}), minimum_frame_duration(engine::fps::v60),
+        scenes(), current_timestamp(clock::now()), curr_scene() {}
+
+  game_dispatch::current_scene_info::current_scene_info() {}
+
+  game_dispatch::current_scene_info::current_scene_info(scene * curr)
+      : ptr(curr), current_scene_id(ptr->id), local_size(ptr->get_size()) {}
+
+  void game_dispatch::process_key_event(raw_key_t key, bool press) {
+    if (!curr_scene.is_keyboard_event) return;
+    auto const & binding = curr_scene.ptr->get_binding();
+    auto it = binding.find(key);
+    if (it == binding.end()) return;
+
+    curr_scene.ptr->handle_key_event(
+        {it->second, mask(event::KEY_MASK, press)});
   }
-  
-  void game_dispatch::process_mouse_event( math::vec2 mouse_pos, bool press ) {
-    if ( ! curr_scene.is_mouse_event ) return;
-    math::vec2 local_scene_position = mouse_pos * curr_scene.local_size / screen_size;
-
-    curr_scene.ptr->handle_mouse_event( {
-      local_scene_position,
-      mask( event::MOUSE_MASK, press )
-    } );
+
+  void game_dispatch::process_mouse_event(math::vec2 mouse_pos, bool press) {
+    if (!curr_scene.is_mouse_event) return;
+    math::vec2 local_scene_position =
+        mouse_pos * curr_scene.local_size / screen_size;
+
+    curr_scene.ptr->handle_mouse_event(
+        {local_scene_position, mask(event::MOUSE_MASK, press)});
   }
-  
-  tick game_dispatch::get_tick( ) {
-    timestamp now = clock::now( );
-    return { now, now - current_timestamp };
+
+  tick game_dispatch::get_tick() {
+    timestamp now = clock::now();
+    return {now, now - current_timestamp};
   }
-  
-  tick game_dispatch::next_frame( ) {
-    tick t = get_tick( );
-    
-    while ( t.since < minimum_frame_duration ) {
-      std::this_thread::sleep_for( minimum_frame_duration - t.since );
-      t = get_tick( );
+
+  tick game_dispatch::next_frame() {
+    tick t = get_tick();
+
+    while (t.since < minimum_frame_duration) {
+      std::this_thread::sleep_for(minimum_frame_duration - t.since);
+      t = get_tick();
     }
-    
+
     current_timestamp = t.now;
     return t;
   }
-  
-  void game_dispatch::gameloop( ) try {
-    while ( running ) { single_frame( next_frame( ) ); }
-    cleanup_resources( );
-    exit( EXIT_SUCCESS );
-  } catch ( std::exception const & ex ) {
+
+  void game_dispatch::gameloop() try {
+    while (running) {
+      single_frame(next_frame());
+    }
+    cleanup_resources();
+    exit(EXIT_SUCCESS);
+  } catch (std::exception const & ex) {
     // todo: logging
-    exit( EXIT_FAILURE );
-  }
-  
-  void game_dispatch::quit( ) {
-    running = false;
+    exit(EXIT_FAILURE);
   }
+
+  void game_dispatch::quit() { running = false; }
 }

+ 16 - 28
engine/src/scene.cpp

@@ -11,34 +11,22 @@
 #include "game/engine/game_dispatch.hpp"
 
 namespace engine {
-  
-  
-  scene::~scene( ) { }
-  
-  void scene::update( tick ) {
-    
-  }
-  
-  void scene::render( ) {
-    
-  }
-  
-  void scene::handle_key_event( event::key_event evt ) {
-    if ( evt.type & event::PRESSED_MASK &&
-        evt.key == key::QUIT ) {
-      dispatch.lock()->quit( );
+
+  scene::~scene() {}
+
+  void scene::update(tick) {}
+
+  void scene::render() {}
+
+  void scene::handle_key_event(event::key_event evt) {
+    if (evt.type & event::PRESSED_MASK && evt.key == key::QUIT) {
+      dispatch.lock()->quit();
     }
   }
-  
-  void scene::handle_mouse_event( event::mouse_event evt ) {
-    
-  }
-  
-  math::vec2 scene::get_size( ) const {
-    return local_scene_dimension;
-  }
-  
-  key_binding const & scene::get_binding( ) const {
-    return keys;
-  }
+
+  void scene::handle_mouse_event(event::mouse_event evt) {}
+
+  math::vec2 scene::get_size() const { return local_scene_dimension; }
+
+  key_binding const & scene::get_binding() const { return keys; }
 }

+ 6 - 6
engine/src/time.cpp

@@ -10,10 +10,10 @@
 namespace engine {
   using std::chrono::duration_cast;
   using std::chrono::nanoseconds;
-  
-  duration const fps::v24 { nanoseconds{ 41666666 } };
-  duration const fps::v30 { nanoseconds{ 33333333 } };
-  duration const fps::v60 { nanoseconds{ 16666666 } };
-  duration const fps::v120{ nanoseconds{  8333333 } };
-  duration const fps::v144{ nanoseconds{  6944444 } };
+
+  duration const fps::v24{nanoseconds{41666666}};
+  duration const fps::v30{nanoseconds{33333333}};
+  duration const fps::v60{nanoseconds{16666666}};
+  duration const fps::v120{nanoseconds{8333333}};
+  duration const fps::v144{nanoseconds{6944444}};
 }

+ 1 - 0
graphics/include/game/graphics/material.hpp

@@ -15,6 +15,7 @@ namespace graphics {
   class material : public identity<material> {
   public:
     program const shaders;
+
   private:
     material(unsigned int, program);
   };

+ 1 - 1
graphics/include/game/graphics/object.hpp

@@ -18,7 +18,7 @@ namespace graphics {
     math::vec2 corner;
     math::vec2 size;
   };
-  
+
   struct object {
     bound location;
     math::quad points;

+ 6 - 5
graphics/include/game/graphics/texture.hpp

@@ -8,21 +8,22 @@
 #pragma once
 
 #include "game/math/math_fwd.hpp"
-#include "vector/vector.hpp"
 #include "util/identity.hpp"
+#include "vector/vector.hpp"
 
 namespace graphics {
   class texture : public identity<texture> {
   public:
     static texture create(std::string const & imagefile);
-    
+
     static texture const WHITE;
     static texture const DARK_YELLOW;
     static texture const LIGHT_BLUE;
-    
+
     math::vec2i const size;
+
   private:
-    static texture create( unsigned char *, math::vec2i );
-    texture( unsigned int, math::vec2i = math::vec2i{{0, 0}} );
+    static texture create(unsigned char *, math::vec2i);
+    texture(unsigned int, math::vec2i = math::vec2i{{0, 0}});
   };
 }

+ 22 - 24
graphics/src/texture.cpp

@@ -9,8 +9,8 @@
 
 #include "scope_guard/scope_guard.hpp"
 
-#include <unordered_map>
 #include <string>
+#include <unordered_map>
 
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wcomma"
@@ -18,56 +18,54 @@
 #include "stb/stb_image.h"
 #pragma clang diagnostic pop
 
-unsigned char * stbi_load( char const *, int *, int *, int *, int );
-void stbi_image_free( void * );
+unsigned char * stbi_load(char const *, int *, int *, int *, int);
+void stbi_image_free(void *);
 
-template <typename T, typename Key = std::string>
-class private_factory {
+template <typename T, typename Key = std::string> class private_factory {
 public:
   using key_t = Key;
-  
-  template <typename... Args>
-  static T create(key_t const & key) {
+
+  template <typename... Args> static T create(key_t const & key) {
     auto found = instances.find(key);
     if (found == instances.end()) {
       found = instances.emplace(key, T::create(key)).first;
     }
     return found->second;
   }
+
 private:
   static std::unordered_map<key_t, T> instances;
 };
 
 namespace graphics { namespace detail { namespace texture {
   struct format {};
-      
+
   std::unordered_map<std::string, ::graphics::texture> g_textures;
-    
+
   unsigned int init(format = {}, math::vec2i = {}, unsigned char * = {}) {
     throw; // TODO implement
   }
-} } }
+}}}
 
 namespace graphics {
-  texture texture::create( std::string const & imagefile ) {
+  texture texture::create(std::string const & imagefile) {
     using detail::texture::g_textures;
     auto found = g_textures.find(imagefile);
     if (found != g_textures.end()) { return found->second; }
-    
+
     int components = 0;
     math::vec2i size;
-    unsigned char * data = stbi_load(imagefile.c_str(), &size.x(), &size.y(),
-                                     &components, 0);
-    scope(exit) { stbi_image_free( data ); };
-    texture tex{ detail::texture::init({}, size, data), size };
+    unsigned char * data =
+        stbi_load(imagefile.c_str(), &size.x(), &size.y(), &components, 0);
+    scope(exit) { stbi_image_free(data); };
+    texture tex{detail::texture::init({}, size, data), size};
     return g_textures.emplace(imagefile, std::move(tex)).first->second;
   }
-  
-  texture texture::create( unsigned char * data, math::vec2i size ) {
-    return { detail::texture::init({}, size, data), size };
-  }
-  
-  texture::texture( unsigned int id, math::vec2i sz )
-  : identity<graphics::texture>(id), size(sz) {
+
+  texture texture::create(unsigned char * data, math::vec2i size) {
+    return {detail::texture::init({}, size, data), size};
   }
+
+  texture::texture(unsigned int id, math::vec2i sz)
+      : identity<graphics::texture>(id), size(sz) {}
 }

+ 2 - 2
math/include/game/math/angle.hpp

@@ -11,14 +11,14 @@ namespace math {
   struct degree {
     double value;
   };
-  
+
   struct radian {
     radian(double v);
     radian(degree d);
     operator degree() const;
     double value;
   };
-  
+
   double sin(radian r);
   double cos(radian r);
 }

+ 8 - 9
math/include/game/math/math_fwd.hpp

@@ -16,26 +16,25 @@ namespace math {
   }
   namespace matrix {
     template <typename, size_t, size_t> class matrix;
-    
-    template <typename T, size_t N>
-    using square_matrix = matrix<T, N, N>;
+
+    template <typename T, size_t N> using square_matrix = matrix<T, N, N>;
   }
-  
+
   struct line;
   struct circle;
   struct quad;
   struct rectangle;
   struct square;
-  
+
   struct degree;
   struct radian;
 }
 
 namespace math {
   using vec2i = vector::vector<int, 2>;
-  using vec2  = vector::vector<float, 2>;
-  using vec3  = vector::vector<float, 3>;
-  using rgba  = vector::vector<uint8_t, 4>;
-  
+  using vec2 = vector::vector<float, 2>;
+  using vec3 = vector::vector<float, 3>;
+  using rgba = vector::vector<uint8_t, 4>;
+
   using matr4 = matrix::matrix<float, 4, 4>;
 }

+ 5 - 5
math/include/game/math/shape.hpp

@@ -15,25 +15,25 @@ namespace math {
   struct line {
     vec2 first, second;
   };
-  
+
   struct circle {
     vec2 center;
     float radius;
   };
-  
+
   struct quad {
     vec2 ll, lr, ur, ul;
   };
-  
+
   struct rectangle {
     operator quad() const;
     vec2 origin, size;
   };
-    
+
   struct square {
     operator rectangle() const;
     operator quad() const;
     vec2 origin;
     float size;
-  };  
+  };
 }

+ 2 - 2
math/src/angle.cpp

@@ -12,8 +12,8 @@
 namespace math {
   radian::radian(double v) : value(v) {}
   radian::radian(degree d) : value(d.value / M_2_PI) {}
-  radian::operator degree() const { return { value * M_2_PI }; }
-  
+  radian::operator degree() const { return {value * M_2_PI}; }
+
   double sin(radian r) { return std::sin(r.value); }
   double cos(radian r) { return std::cos(r.value); }
 }

+ 4 - 11
math/src/common.cpp

@@ -15,18 +15,11 @@ namespace math {
     vec2 trans = p - c;
     vec2 vcos = trans * static_cast<float>(cos(r));
     vec2 vsin = trans * static_cast<float>(sin(r));
-    return {{
-      vcos[0] - vsin[1] + c[0],
-      vsin[0] - vcos[1] + c[1]
-    }};
+    return {{vcos[0] - vsin[1] + c[0], vsin[0] - vcos[1] + c[1]}};
   }
-  
+
   quad rotate(vec2 const & c, quad const & q, radian r) {
-    return {
-      rotate(c, q.ll, r),
-      rotate(c, q.lr, r),
-      rotate(c, q.ur, r),
-      rotate(c, q.ul, r)
-    };
+    return {rotate(c, q.ll, r), rotate(c, q.lr, r), rotate(c, q.ur, r),
+            rotate(c, q.ul, r)};
   }
 }

+ 7 - 16
math/src/shape.cpp

@@ -8,27 +8,18 @@
 #include "game/math/shape.hpp"
 
 namespace math {
-  
+
   rectangle::operator quad() const {
-    return {
-      origin,
-      origin + vec2{{size.x(), 0.0}},
-      origin + size,
-      origin + vec2{{0.0, size.y()}}
-    };
+    return {origin, origin + vec2{{size.x(), 0.0}}, origin + size,
+            origin + vec2{{0.0, size.y()}}};
   }
 
   square::operator rectangle() const {
-    return { origin, origin + vec2{{size, size}} };
+    return {origin, origin + vec2{{size, size}}};
   }
-  
+
   square::operator quad() const {
-    return {
-      origin,
-      origin + vec2{{size, 0.0 }},
-      origin + vec2{{size, size}},
-      origin + vec2{{ 0.0, size}}
-    };
+    return {origin, origin + vec2{{size, 0.0}}, origin + vec2{{size, size}},
+            origin + vec2{{0.0, size}}};
   }
-  
 }

+ 4 - 4
util/identity.hpp

@@ -9,12 +9,12 @@
 
 #include <type_traits>
 
-template <typename T, typename ID = unsigned int>
-class identity {
+template <typename T, typename ID = unsigned int> class identity {
 public:
   ID const id;
+
 private:
   friend T;
-  identity( ID _id ) : id( std::move( _id ) ) {}
-  identity( ) = delete;
+  identity(ID _id) : id(std::move(_id)) {}
+  identity() = delete;
 };