mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
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:
parent
d5e3d5dd63
commit
12ac0f7d27
@ -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 };
|
||||
|
Loading…
Reference in New Issue
Block a user