Use constexpr when makes sense

No functional change.
This commit is contained in:
Guy Vreuls
2017-11-26 04:33:34 +01:00
committed by Marco Costalba
parent ccd6bad512
commit 28b6a457c2
3 changed files with 46 additions and 48 deletions

View File

@@ -126,7 +126,7 @@ inline Bitboard& operator^=(Bitboard& b, Square s) {
return b ^= SquareBB[s];
}
inline bool more_than_one(Bitboard b) {
constexpr bool more_than_one(Bitboard b) {
return b & (b - 1);
}
@@ -154,7 +154,7 @@ inline Bitboard file_bb(Square s) {
/// shift() moves a bitboard one step along direction D. Mainly for pawns
template<Square D>
inline Bitboard shift(Bitboard b) {
constexpr Bitboard shift(Bitboard b) {
return D == NORTH ? b << 8 : D == SOUTH ? b >> 8
: D == NORTH_EAST ? (b & ~FileHBB) << 9 : D == SOUTH_EAST ? (b & ~FileHBB) >> 7
: D == NORTH_WEST ? (b & ~FileABB) << 7 : D == SOUTH_WEST ? (b & ~FileABB) >> 9