This repository was archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Home
LH_Mouse edited this page Jan 7, 2018
·
20 revisions
- Use tabs for indentation and spaces for alignment. Do not mistake one for the other. If a language requires you to use tabs where spaces are generally expected, or vice versa, that language will disappear.
- All text files must be in UTF-8 without BOM, unless required otherwise.
- Disable no matter what the f@#k automatic formatting feature of your editor, especially when modifying others' code.
- Use
boolwhere possible. Avoid_Boolorint.BOOLis not a thing. - No public function will call
longjmp(). - Add macros in headers for C++, which usually expand to nothing in C, but expand to proper
extern "C",noexceptetc in C++. - Do not use
-fexceptions. No function will be allowed to throw exceptions directly or indirectly. Hence all functions must be seen asnoexceptin C++.
- Do not use
deleteordelete[]. Use ofnewornew[]is deprecated. Usestd::make_uniqueorstd::vectorwhere possible. - Prefer unsigned integers to signed ones. Do not use signed ones unless you have to.
- Use declarative integral types such as
std::size_t,std::ptrdiff_t,std::int32_tetc. Never mistakelongforstd::int64_twhatsoever. Avoid plainint. - Always declare a virtual destructor as the first virtual function of the class it belongs to.
- Do not define the virtual destructor of a class (but not that of a class template) in a header, including ones declared or defined implicitly. That is, should it be useful, declare it explicitly in that header, then define it elsewhere.
-
virtualbases must be stateless. - No move constructor, move assignment operator or ADL'd
swapfunctions shall throw exceptions. - No unary
operator&(the address-of operator),operator&&(the logical and operator) oroperator||(the logical or operator) shall be overloaded.
-
git mergewithout--ff-onlyis prohibited. -
git pullis prohibited as well, because it is equivalent togit fetch && git merge FETCH_HEAD. Howevergit pull --rebaseis allowed in addition togit pull --ff-only. - Force-pushing is disallowed for master or release branches.