<commit_before>#include <archie/utils/test.h>
#include <archie/utils/fused/back.h>

namespace meta = archie::utils::meta;

template <typename Tp>
decltype(auto) second(meta::ignore, Tp&& t, ...) {
  return std::forward<Tp>(t);
}

void canUseEatToTakeSecondArgument() {
  auto sec = second(1u, 2.0, '3');
  EXPECT_EQ(2.0, sec);
}

namespace fused = archie::utils::fused;

void canUseBackWithRValue() {
  auto a = fused::back(1u, 2.0, '3');
  EXPECT_EQ('3', a);
}

void canUseBackWithLValue() {
  unsigned a = 1u;
  double b = 2.0;
  char c = '3';
  auto const& x = fused::back(a, b, c);
  EXPECT_EQ('3', x);
  EXPECT_EQ(&c, &x);
}

int main() {
  canUseEatToTakeSecondArgument();
  canUseBackWithRValue();
  canUseBackWithLValue();
  return 0;
}<commit_msg>cover uncopyable types in fused::back test<commit_after>#include <archie/utils/test.h>
#include <archie/utils/fused/back.h>

namespace meta = archie::utils::meta;

template <typename Tp>
decltype(auto) second(meta::ignore, Tp&& t, ...) {
  return std::forward<Tp>(t);
}

void canUseEatToTakeSecondArgument() {
  auto sec = second(1u, 2.0, '3');
  EXPECT_EQ(2.0, sec);
}

namespace fused = archie::utils::fused;

#include <memory>

void canUseBackWithRValue() {
  auto a = fused::back(std::make_unique<unsigned>(1u), 2.0, '3');
  EXPECT_EQ('3', a);
}

void canUseBackWithLValue() {
  auto a = std::make_unique<unsigned>(1u);
  double b = 2.0;
  char c = '3';
  auto const& x = fused::back(a, b, c);
  EXPECT_EQ('3', x);
  EXPECT_EQ(&c, &x);
}

int main() {
  canUseEatToTakeSecondArgument();
  canUseBackWithRValue();
  canUseBackWithLValue();
  return 0;
}
{'fraction_non_alphanumeric': 0.18300248138957817, 'fraction_numerical': 0.02109181141439206, 'mean_word_length': 4.823104693140794, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2926905', 'n_tokens_mistral': 663, 'n_tokens_neox': 649, 'n_words': 137}