Skip to content

Commit 1ed89ee

Browse files
authored
Merge pull request #3340 from eseiler/fix/sdsl
[FIX] std::is_trivial is deprecated (sdsl)
2 parents f9e5403 + 50cd9ce commit 1ed89ee

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

include/seqan3/contrib/sdsl-lite.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// * All comments were removed.
1111
// * "SDSL_" was replaced with "SDSL3_". This affects macros and include guards.
1212
// * The namespace was changed from "sdsl" to "seqan3::contrib::sdsl".
13+
// * "std::is_trivial" was replaced with "is_trivially_default_constructible && is_trivially_copyable".
1314

1415
#pragma once
1516

@@ -3170,7 +3171,7 @@ serialize(X const & x, std::ostream & out, structure_tree_node * v = nullptr, st
31703171
return x.serialize(out, v, name);
31713172
}
31723173
template <typename X>
3173-
typename std::enable_if<std::is_standard_layout<X>::value && std::is_trivial<X>::value, uint64_t>::type
3174+
typename std::enable_if<std::is_standard_layout<X>::value && std::is_trivially_default_constructible<X>::value && std::is_trivially_copyable<X>::value, uint64_t>::type
31743175
serialize(X const & x, std::ostream & out, structure_tree_node * v = nullptr, std::string name = "")
31753176
{
31763177
return write_member(x, out, v, name);
@@ -3187,7 +3188,7 @@ typename std::enable_if<has_load<X>::value, void>::type load(X & x, std::istream
31873188
x.load(in);
31883189
}
31893190
template <typename X>
3190-
typename std::enable_if<std::is_standard_layout<X>::value && std::is_trivial<X>::value, void>::type
3191+
typename std::enable_if<std::is_standard_layout<X>::value && std::is_trivially_default_constructible<X>::value && std::is_trivially_copyable<X>::value, void>::type
31913192
load(X & x, std::istream & in)
31923193
{
31933194
read_member(x, in);

test/scripts/amalgamate-sdsl.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ CONTENT=${CONTENT//SDSL_/SDSL3_}
5050
CONTENT=${CONTENT//namespace sdsl/namespace seqan3::contrib::sdsl}
5151
CONTENT=${CONTENT//sdsl::/seqan3::contrib::sdsl::}
5252

53+
## Patches
54+
# [C++26] `std::is_trivial` is deprecated: use `is_trivially_default_constructible && is_trivially_copyable` instead
55+
CONTENT=${CONTENT//std::is_trivial<X>::value/std::is_trivially_default_constructible<X>::value \&\& std::is_trivially_copyable<X>::value}
56+
5357
cat <<EOL > sdsl-lite.hpp
5458
// SPDX-FileCopyrightText: 2016 SDSL Project Authors
5559
// SPDX-License-Identifier: BSD-3-Clause
@@ -63,6 +67,7 @@ cat <<EOL > sdsl-lite.hpp
6367
// * All comments were removed.
6468
// * "SDSL_" was replaced with "SDSL3_". This affects macros and include guards.
6569
// * The namespace was changed from "sdsl" to "seqan3::contrib::sdsl".
70+
// * "std::is_trivial" was replaced with "is_trivially_default_constructible && is_trivially_copyable".
6671
6772
#pragma once
6873

0 commit comments

Comments
 (0)