<commit_before>#ifndef SILICIUM_SINK_APPEND_HPP
#define SILICIUM_SINK_APPEND_HPP

#include <silicium/config.hpp>
#include <silicium/sink/sink.hpp>
#if BOOST_VERSION >= 105300
#	include <boost/utility/string_ref.hpp>
#endif

namespace Si
{
	template <class Sink, class Element>
	auto append(Sink &&out, std::basic_string<Element> const &str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(str.data(), str.data() + str.size()));
	}

	template <class Sink, class Element>
	auto append(Sink &&out, boost::container::basic_string<Element> const &str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(str.data(), str.data() + str.size()));
	}

#if BOOST_VERSION >= 105300
	template <class Sink, class Element, class CharTraits>
	auto append(Sink &&out, boost::basic_string_ref<Element, CharTraits> const &str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_memory_range(str));
	}
#endif

	template <class Sink, class Element>
	auto append(Sink &&out, Element const *c_str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(c_str, c_str + std::char_traits<Element>::length(c_str)));
	}

	template <class Sink, class Element>
	auto append(Sink &&out, Element const &single)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(&single, &single + 1));
	}

	template <class Sink>
	auto append(Sink &&out, iterator_range<typename std::decay<Sink>::type::element_type const *> const &elements)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(elements);
	}
}

#endif<commit_msg>provide append_range to avoid ambiguity between append overloads<commit_after>#ifndef SILICIUM_SINK_APPEND_HPP
#define SILICIUM_SINK_APPEND_HPP

#include <silicium/config.hpp>
#include <silicium/sink/sink.hpp>
#if BOOST_VERSION >= 105300
#	include <boost/utility/string_ref.hpp>
#endif

namespace Si
{
	template <class Sink, class Element>
	auto append(Sink &&out, std::basic_string<Element> const &str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(str.data(), str.data() + str.size()));
	}

	template <class Sink, class Element>
	auto append(Sink &&out, boost::container::basic_string<Element> const &str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(str.data(), str.data() + str.size()));
	}

#if BOOST_VERSION >= 105300
	template <class Sink, class Element, class CharTraits>
	auto append(Sink &&out, boost::basic_string_ref<Element, CharTraits> const &str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_memory_range(str));
	}
#endif

	template <class Sink, class Element>
	auto append(Sink &&out, Element const *c_str)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(c_str, c_str + std::char_traits<Element>::length(c_str)));
	}

	template <class Sink, class Element>
	auto append(Sink &&out, Element const &single)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(make_iterator_range(&single, &single + 1));
	}

	template <class Sink>
	auto append(Sink &&out, iterator_range<typename std::decay<Sink>::type::element_type const *> const &elements)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(elements);
	}

	template <class Sink>
	auto append_range(Sink &&out, iterator_range<typename std::decay<Sink>::type::element_type const *> const &elements)
#if !SILICIUM_COMPILER_HAS_AUTO_RETURN_TYPE
		-> typename error_type<Sink>::type
#endif
	{
		return out.append(elements);
	}
}

#endif
{'fraction_non_alphanumeric': 0.12782316194137433, 'fraction_numerical': 0.006246996636232581, 'mean_word_length': 6.723562152133581, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 66, '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': '1746727', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1549, 'n_words': 304}