This repository has been 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
bool
where possible. Avoid_Bool
orint
.BOOL
is 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"
,noexcept
etc in C++. - Do not use
-fexceptions
. No function will be allowed to throw exceptions directly or indirectly. Hence all functions must be seen asnoexcept
in C++.
- Do not use
delete
ordelete[]
. Use ofnew
ornew[]
is deprecated. Usestd::make_unique
orstd::vector
where 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_t
etc. Never mistakelong
forstd::int64_t
whatsoever. 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.
-
virtual
bases must be stateless. - No move constructor, move assignment operator or ADL'd
swap
functions shall throw exceptions. - No unary
operator&
(the address-of operator),operator&&
(the logical and operator) oroperator||
(the logical or operator) shall be overloaded.
-
git merge
without--ff-only
is prohibited. -
git pull
is prohibited as well, because it is equivalent togit fetch && git merge FETCH_HEAD
. Howevergit pull --rebase
is allowed in addition togit pull --ff-only
. - Force-pushing is disallowed for master or release branches.