mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
49385c8a07
Summary: C++17 Reviewed By: fanzeyi Differential Revision: D28966939 fbshipit-source-id: c8c9d49bc02557263a6acf9357c90b50e04fbdb9
33 lines
687 B
C++
33 lines
687 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#include "eden/fs/store/KeySpace.h"
|
|
|
|
namespace facebook::eden {
|
|
|
|
// Older versions of MSVC++ ICE on the following code.
|
|
#if !defined(_MSC_FULL_VER) || _MSC_FULL_VER >= 192027508
|
|
|
|
namespace {
|
|
constexpr bool assertKeySpaceInvariants() {
|
|
size_t index = 0;
|
|
for (auto& ks : KeySpace::kAll) {
|
|
if (index != ks->index) {
|
|
return false;
|
|
}
|
|
index += 1;
|
|
}
|
|
return index == KeySpace::kTotalCount;
|
|
}
|
|
} // namespace
|
|
|
|
static_assert(assertKeySpaceInvariants());
|
|
|
|
#endif
|
|
|
|
} // namespace facebook::eden
|