mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
d23773e9b0
Summary: Simplify the definition and use of KeySpace and move it into its own header. Reviewed By: simpkins Differential Revision: D19353441 fbshipit-source-id: ef07677d927a48839b709711388abeb3c1ed9679
35 lines
711 B
C++
35 lines
711 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 {
|
|
namespace eden {
|
|
|
|
// Older versions of MSVC++ ICE on the following code.
|
|
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 191627035
|
|
|
|
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 eden
|
|
} // namespace facebook
|