use assert() rather than DCHECK_NE() in the InodeNumber constructor

Summary:
`DCHECK_NE()` unfortunately is not constexpr, so it results in a build error
when used in a constexpr function.  Fortunately `assert()` is allowed in
constexpr functions as of C++14, so use it instead.

Reviewed By: wez

Differential Revision: D7108887

fbshipit-source-id: 2be9181929a357c23f48c09173646683060aad28
This commit is contained in:
Adam Simpkins 2018-02-28 11:15:33 -08:00 committed by Facebook Github Bot
parent d5e3d5dd63
commit 12ac0f7d27

View File

@ -36,7 +36,9 @@ struct InodeNumber {
* initialized to zero.
*/
constexpr explicit InodeNumber(uint64_t ino) noexcept : rawValue_{ino} {
DCHECK_NE(0, rawValue_);
// This is intentionally an assert() rather than DCHECK_NE() since
// DCHECK_NE is not allowed in constexpr methods.
assert(0 != rawValue_);
}
enum NoCheck { NO_CHECK };