<commit_before>#ifndef COMPOSE_HPP
# define COMPOSE_HPP
# pragma once

#include <type_traits>

#include <utility>

namespace
{

template <typename R, typename ...A>
struct signature
{
};

template <typename R, typename ...A>
constexpr auto extract_signature(R (*const)(A...)) noexcept
{
  return signature<R, A...>();
}

template <typename C, typename R, typename ...A>
constexpr auto extract_signature(R (C::* const)(A...)) noexcept
{
  return signature<R, A...>();
}

template <typename C, typename R, typename ...A>
constexpr auto extract_signature(R (C::* const)(A...) const) noexcept
{
  return signature<R, A...>();
}

template <typename F>
constexpr auto extract_signature(F const&) noexcept ->
  decltype(&F::operator(), extract_signature(&F::operator()))
{
  return extract_signature(&F::operator());
}

template <typename F1, typename F2, typename R2, typename ...A1>
class composer
{
  F1 const f1_;
  F2 const f2_;

public:
  explicit composer(F1&& f1, F2&& f2) noexcept :
    f1_(::std::forward<F1>(f1)),
    f2_(::std::forward<F2>(f2))
  {
  }

  R2 operator()(A1&& ...args) const noexcept(
    noexcept(f2_(f1_(::std::forward<A1>(args)...)))
  )
  {
    return f2_(f1_(::std::forward<A1>(args)...));
  }
};

template <
  typename F1, typename R1, typename ...A1,
  typename F2, typename R2, typename ...A2
>
inline auto compose(
  F1&& f1, signature<R1, A1...> const,
  F2&& f2, signature<R2, A2...> const) noexcept(
  noexcept(
    composer<F1, F2, R2, A1...>(::std::forward<F1>(f1),
      ::std::forward<F2>(f2)
    )
  )
)
{
  return composer<F1, F2, R2, A1...>(::std::forward<F1>(f1),
    ::std::forward<F2>(f2)
  );
}

}

template <typename F1, typename F2>
inline auto operator|(F1&& f1, F2&& f2) noexcept(
  noexcept(
    compose(
      ::std::forward<F1>(f1), extract_signature(f1),
      ::std::forward<F2>(f2), extract_signature(f2)
    )
  )
)
{
  return compose(
    ::std::forward<F1>(f1), extract_signature(f1),
    ::std::forward<F2>(f2), extract_signature(f2)
  );
}

#endif // COMPOSE_HPP
<commit_msg>some fixes<commit_after>#ifndef COMPOSE_HPP
# define COMPOSE_HPP
# pragma once

#include <utility>

namespace
{

template <typename R, typename ...A>
struct signature
{
};

template <typename R, typename ...A>
constexpr auto extract_signature(R (*const)(A...)) noexcept
{
  return signature<R, A...>();
}

template <typename C, typename R, typename ...A>
constexpr auto extract_signature(R (C::* const)(A...)) noexcept
{
  return signature<R, A...>();
}

template <typename C, typename R, typename ...A>
constexpr auto extract_signature(R (C::* const)(A...) const) noexcept
{
  return signature<R, A...>();
}

template <typename F>
constexpr auto extract_signature(F const&) noexcept ->
  decltype(&F::operator(), extract_signature(&F::operator()))
{
  return extract_signature(&F::operator());
}

template <typename F1, typename F2, typename ...A1>
class composer
{
  F1 const f1_;
  F2 const f2_;

public:
  explicit composer(F1&& f1, F2&& f2) noexcept :
    f1_(::std::forward<F1>(f1)),
    f2_(::std::forward<F2>(f2))
  {
  }

  auto operator()(A1&& ...args) const noexcept(
    noexcept(f2_(f1_(::std::forward<A1>(args)...)))
  )
  {
    return f2_(f1_(::std::forward<A1>(args)...));
  }
};

template <
  typename F1, typename R1, typename ...A1,
  typename F2, typename R2, typename ...A2
>
inline auto compose(
  F1&& f1, signature<R1, A1...> const,
  F2&& f2, signature<R2, A2...> const) noexcept(
  noexcept(
    composer<F1, F2, A1...>(::std::forward<F1>(f1),
      ::std::forward<F2>(f2)
    )
  )
)
{
  return composer<F1, F2, A1...>(::std::forward<F1>(f1),
    ::std::forward<F2>(f2)
  );
}

}

template <typename F1, typename F2>
inline auto operator|(F1&& f1, F2&& f2) noexcept(
  noexcept(
    compose(
      ::std::forward<F1>(f1), extract_signature(f1),
      ::std::forward<F2>(f2), extract_signature(f2)
    )
  )
)
{
  return compose(
    ::std::forward<F1>(f1), extract_signature(f1),
    ::std::forward<F2>(f2), extract_signature(f2)
  );
}

#endif // COMPOSE_HPP

{'fraction_non_alphanumeric': 0.19701492537313434, 'fraction_numerical': 0.03582089552238806, 'mean_word_length': 3.995031055900621, 'pattern_counts': {'":': 0, '<': 60, '<?xml version=': 0, '>': 62, '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': '1293317', 'n_tokens_mistral': 1583, 'n_tokens_neox': 1531, 'n_words': 345}