修订版 | 5274 (tree) |
---|---|
时间 | 2018-05-29 22:47:56 |
作者 | bolero-murakami |
(empty log message)
@@ -286,7 +286,7 @@ | ||
286 | 286 | template<sprout::index_t... Indexes> |
287 | 287 | SPROUT_CXX14_CONSTEXPR void |
288 | 288 | swap_impl(tuple& other, sprout::index_tuple<Indexes...>) { |
289 | - sprout::swallow({sprout::unused(sprout::swap(base_type::template get<Indexes>(*this), base_type::template get<Indexes>(other)))...}); | |
289 | + sprout::swallow({(sprout::swap(base_type::template get<Indexes>(*this), base_type::template get<Indexes>(other)), 0)...}); | |
290 | 290 | } |
291 | 291 | template<typename Tuple> |
292 | 292 | SPROUT_CXX14_CONSTEXPR void |
@@ -297,7 +297,7 @@ | ||
297 | 297 | SPROUT_CXX14_CONSTEXPR void |
298 | 298 | assign_impl(Tuple&& t, sprout::index_tuple<Indexes...>) { |
299 | 299 | typedef typename std::decay<Tuple>::type type; |
300 | - sprout::swallow({sprout::unused(base_type::template get<Indexes>(*this) = sprout::move(type::template get<Indexes>(SPROUT_FORWARD(Tuple, t))))...}); | |
300 | + sprout::swallow({((base_type::template get<Indexes>(*this) = sprout::move(type::template get<Indexes>(SPROUT_FORWARD(Tuple, t)))), 0)...}); | |
301 | 301 | } |
302 | 302 | template<sprout::index_t... Indexes> |
303 | 303 | SPROUT_CONSTEXPR std::tuple<Types...> |
@@ -18,7 +18,6 @@ | ||
18 | 18 | // |
19 | 19 | // example: |
20 | 20 | // swallow({(void)pack, 0}...); |
21 | - // swallow({unused(pack)...}); | |
22 | 21 | // ((void)pack, ..., swallow); // right fold, since C++17 |
23 | 22 | // (swallow, ..., (void)pack); // left fold, since C++17 |
24 | 23 | // |
@@ -49,7 +48,7 @@ | ||
49 | 48 | struct unused_t { |
50 | 49 | public: |
51 | 50 | template<typename... Args> |
52 | - SPROUT_CONSTEXPR unused_t const& | |
51 | + SPROUT_CONSTEXPR sprout::unused_t const& | |
53 | 52 | operator()(Args&&...) const SPROUT_NOEXCEPT { |
54 | 53 | return *this; |
55 | 54 | } |