diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-22 10:48:25 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-22 10:50:38 +0100 |
commit | e736b67467ef98c195eb0fa073f539a2613333be (patch) | |
tree | 9908a0b4c4638ace584dcf8d7b4ed65cd1f67505 /src/bench | |
parent | d7b0258ff037ae90f60a86fc68cb55069c96e8d0 (diff) | |
parent | 69ca48717ceb31e37e90276278362c809cf98cc6 (diff) |
Merge #14715: Drop defunct prevector compat handling
69ca48717ceb31e37e90276278362c809cf98cc6 Implement prevector::fill once (Ben Woosley)
7bad78c2c83d73b7e0518f3e1b835f0157b80ec6 Drop defunct IS_TRIVIALLY_CONSTRUCTIBLE handling from prevector.h (Ben Woosley)
Pull request description:
This is clean-up post #14651:
* Use one implementation of `prevector::fill`, as it's possible now that the implementations are identical.
* Only apply the `IS_TRIVIALLY_CONSTRUCTIBLE` handling to the bench file where it is used, and drop the now-unnecessary associated compat includes.
Tree-SHA512: 5930b3a17fccd39af10add40202ad97a297aebecc049af72ca920d0d55b3e4c3c30ce864c8a683355895f0196396d4ea56ba9f9637bdc7d16964cdf66c195485
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/prevector.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bench/prevector.cpp b/src/bench/prevector.cpp index 8cc404b9e2..00e5d7e7a0 100644 --- a/src/bench/prevector.cpp +++ b/src/bench/prevector.cpp @@ -2,13 +2,21 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include <compat.h> #include <prevector.h> #include <serialize.h> #include <streams.h> +#include <type_traits> #include <bench/bench.h> +// GCC 4.8 is missing some C++11 type_traits, +// https://www.gnu.org/software/gcc/gcc-5/changes.html +#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5 +#define IS_TRIVIALLY_CONSTRUCTIBLE std::has_trivial_default_constructor +#else +#define IS_TRIVIALLY_CONSTRUCTIBLE std::is_trivially_default_constructible +#endif + struct nontrivial_t { int x; nontrivial_t() :x(-1) {} |