Skip to content

Commit 159472a

Browse files
committed
Change moves to forwards where appropriate.
Addresses the same issues as PR #276.
1 parent bfa3e33 commit 159472a

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

include/boost/parser/detail/text/detail/all_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ namespace boost::parser::detail::text::detail {
126126
else if constexpr (can_ref_view<R>)
127127
return ref_view(r);
128128
else
129-
return owning_view<T>(std::move(r));
129+
return owning_view<T>((R &&)r);
130130
}
131131
};
132132

include/boost/parser/parser.hpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ namespace boost { namespace parser {
13621362
auto const r = cps | text::as_utf8;
13631363
c.insert(c.end(), r.begin(), r.end());
13641364
} else {
1365-
detail::insert(c, std::move(x));
1365+
detail::insert(c, (T &&)x);
13661366
}
13671367
}
13681368

@@ -1951,9 +1951,9 @@ namespace boost { namespace parser {
19511951
template<typename T, typename Tuple, int... Is>
19521952
auto
19531953
make_from_tuple_impl(Tuple && tup, std::integer_sequence<int, Is...>)
1954-
-> decltype(T(parser::get(std::move(tup), llong<Is>{})...))
1954+
-> decltype(T(parser::get((Tuple &&)tup, llong<Is>{})...))
19551955
{
1956-
return T(parser::get(std::move(tup), llong<Is>{})...);
1956+
return T(parser::get((Tuple &&)tup, llong<Is>{})...);
19571957
}
19581958

19591959
template<typename T, typename... Args>
@@ -1987,7 +1987,7 @@ namespace boost { namespace parser {
19871987
auto const r = cps | text::as_utf8;
19881988
c.insert(c.end(), r.begin(), r.end());
19891989
} else if constexpr (std::is_convertible_v<just_u &&, just_t>) {
1990-
detail::insert(c, std::move(x));
1990+
detail::insert(c, (U &&)x);
19911991
} else if constexpr (
19921992
!is_tuple<just_t>::value && is_tuple<just_u>::value &&
19931993
std::is_aggregate_v<just_t> &&
@@ -1996,8 +1996,7 @@ namespace boost { namespace parser {
19961996
auto int_seq =
19971997
std::make_integer_sequence<int, tuple_size_<just_u>>();
19981998
detail::insert(
1999-
c,
2000-
detail::tuple_to_aggregate<just_t>(std::move(x), int_seq));
1999+
c, detail::tuple_to_aggregate<just_t>((U &&)x, int_seq));
20012000
} else if constexpr (
20022001
is_tuple<just_t>::value && !is_tuple<just_u>::value &&
20032002
std::is_aggregate_v<just_u> &&
@@ -2013,8 +2012,7 @@ namespace boost { namespace parser {
20132012
} else if constexpr (is_constructible_from_tuple_v<
20142013
just_t,
20152014
just_u>) {
2016-
detail::insert(
2017-
c, detail::make_from_tuple<just_t>(std::move(x)));
2015+
detail::insert(c, detail::make_from_tuple<just_t>((U &&)x));
20182016
} else {
20192017
static_assert(
20202018
sizeof(U) && false,
@@ -2029,7 +2027,7 @@ namespace boost { namespace parser {
20292027
{
20302028
if (!gen_attrs)
20312029
return;
2032-
detail::move_back_impl(c, std::move(x));
2030+
detail::move_back_impl(c, (T &&)x);
20332031
}
20342032

20352033
template<typename Container>
@@ -2098,15 +2096,15 @@ namespace boost { namespace parser {
20982096
"is almost certainly not what you meant to write, so "
20992097
"Boost.Parser disallows it. If you want to do this, write "
21002098
"a semantic action and do it explicitly.");
2101-
t = std::move(u);
2099+
t = (U &&)u;
21022100
} else if constexpr (
21032101
!is_tuple<just_t>::value && is_tuple<just_u>::value &&
21042102
std::is_aggregate_v<just_t> &&
21052103
!std::is_convertible_v<just_u &&, just_t> &&
21062104
is_struct_assignable_v<just_t, just_u>) {
21072105
auto int_seq =
21082106
std::make_integer_sequence<int, tuple_size_<just_u>>();
2109-
t = detail::tuple_to_aggregate<just_t>(std::move(u), int_seq);
2107+
t = detail::tuple_to_aggregate<just_t>((U &&)u, int_seq);
21102108
} else if constexpr (
21112109
is_tuple<just_t>::value && !is_tuple<just_u>::value &&
21122110
std::is_aggregate_v<just_u> &&
@@ -2120,7 +2118,7 @@ namespace boost { namespace parser {
21202118
} else if constexpr (is_constructible_from_tuple_v<
21212119
just_t,
21222120
just_u>) {
2123-
t = detail::make_from_tuple<just_t>(std::move(u));
2121+
t = detail::make_from_tuple<just_t>((U &&)u);
21242122
} else {
21252123
static_assert(
21262124
sizeof(T) && false,

0 commit comments

Comments
 (0)