Do not rely on the two-argument std::pair constructor being constexpr (#7519)

Summary:
The `std::pair(const T1& x, const T2& y);` constructor is `constexpr`
only starting from C++14; relying on this breaks compilation on certain
compilers/platforms we need to support.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7519

Test Plan: `make check`

Reviewed By: ajkr

Differential Revision: D24195747

Pulled By: ltamasi

fbshipit-source-id: 665e8fbc9747675bb49c5d895aad3dcf2714750f
This commit is contained in:
Levi Tamasi 2020-10-08 10:47:47 -07:00 committed by Facebook GitHub Bot
parent 98c1333806
commit 810ab34ede

View file

@ -329,7 +329,8 @@ TEST_F(BlobFileReaderTest, ExpirationRangeInHeader) {
constexpr uint32_t column_family_id = 1;
constexpr bool has_ttl = false;
constexpr ExpirationRange expiration_range_header(1, 2);
const ExpirationRange expiration_range_header(
1, 2); // can be made constexpr when we adopt C++14
constexpr ExpirationRange expiration_range_footer;
constexpr uint64_t blob_file_number = 1;
constexpr char key[] = "key";
@ -367,7 +368,8 @@ TEST_F(BlobFileReaderTest, ExpirationRangeInFooter) {
constexpr uint32_t column_family_id = 1;
constexpr bool has_ttl = false;
constexpr ExpirationRange expiration_range_header;
constexpr ExpirationRange expiration_range_footer(1, 2);
const ExpirationRange expiration_range_footer(
1, 2); // can be made constexpr when we adopt C++14
constexpr uint64_t blob_file_number = 1;
constexpr char key[] = "key";
constexpr char blob[] = "blob";