<commit_before>#ifndef SILICIUM_VECTOR_HPP
#define SILICIUM_VECTOR_HPP

#include <silicium/config.hpp>
#include <boost/container/vector.hpp>

namespace Si
{
	template <class Element, class Allocator = std::allocator<Element>>
	struct vector
	{
		typedef Element element_type;
		typedef std::size_t size_type;
		typedef typename boost::container::vector<Element, Allocator>::iterator iterator;
		typedef typename boost::container::vector<Element, Allocator>::const_iterator const_iterator;

		vector() BOOST_NOEXCEPT
		{
		}

		vector(vector &&other) BOOST_NOEXCEPT
			: m_impl(std::move(other.m_impl))
		{
		}

		vector &operator = (vector &&other) BOOST_NOEXCEPT
		{
			m_impl = std::move(other.m_impl);
			return *this;
		}

		SILICIUM_DISABLE_COPY(vector)

		vector(std::initializer_list<Element> elements)
			: m_impl(elements)
		{
		}

		vector copy() const
		{
			return vector{m_impl};
		}

		bool empty() const BOOST_NOEXCEPT
		{
			return m_impl.empty();
		}

		size_type size() const BOOST_NOEXCEPT
		{
			return m_impl.size();
		}

		element_type *data() BOOST_NOEXCEPT
		{
			return m_impl.data();
		}

		element_type const *data() const BOOST_NOEXCEPT
		{
			return m_impl.data();
		}

		iterator begin() BOOST_NOEXCEPT
		{
			return m_impl.begin();
		}

		const_iterator begin() const BOOST_NOEXCEPT
		{
			return m_impl.begin();
		}

		iterator end() BOOST_NOEXCEPT
		{
			return m_impl.end();
		}

		const_iterator end() const BOOST_NOEXCEPT
		{
			return m_impl.end();
		}

		template <class ...Args>
		void emplace_back(Args &&...args)
		{
			m_impl.emplace_back(std::forward<Args>(args)...);
		}

	private:

		boost::container::vector<Element, Allocator> m_impl;

		explicit vector(boost::container::vector<Element, Allocator> impl)
			: m_impl(std::move(impl))
		{
		}
	};

	template <class Element, class Allocator>
	bool operator == (vector<Element, Allocator> const &left, vector<Element, Allocator> const &right)
	{
		return (left.size() == right.size()) && std::equal(left.begin(), left.end(), right.begin());
	}
}

#endif
<commit_msg>support Boost <= 1.56<commit_after>#ifndef SILICIUM_VECTOR_HPP
#define SILICIUM_VECTOR_HPP

#include <silicium/config.hpp>
#include <boost/container/vector.hpp>

namespace Si
{
	template <class Element, class Allocator = std::allocator<Element>>
	struct vector
	{
		typedef Element element_type;
		typedef std::size_t size_type;
		typedef typename boost::container::vector<Element, Allocator>::iterator iterator;
		typedef typename boost::container::vector<Element, Allocator>::const_iterator const_iterator;

		vector() BOOST_NOEXCEPT
		{
		}

		vector(vector &&other) BOOST_NOEXCEPT
			: m_impl(std::move(other.m_impl))
		{
		}

		vector &operator = (vector &&other) BOOST_NOEXCEPT
		{
			m_impl = std::move(other.m_impl);
			return *this;
		}

		SILICIUM_DISABLE_COPY(vector)

		vector(std::initializer_list<Element> elements)
			//Boost 1.56 is missing the initializer_list ctor
			: m_impl(elements.begin(), elements.end())
		{
		}

		vector copy() const
		{
			return vector{m_impl};
		}

		bool empty() const BOOST_NOEXCEPT
		{
			return m_impl.empty();
		}

		size_type size() const BOOST_NOEXCEPT
		{
			return m_impl.size();
		}

		element_type *data() BOOST_NOEXCEPT
		{
			return m_impl.data();
		}

		element_type const *data() const BOOST_NOEXCEPT
		{
			return m_impl.data();
		}

		iterator begin() BOOST_NOEXCEPT
		{
			return m_impl.begin();
		}

		const_iterator begin() const BOOST_NOEXCEPT
		{
			return m_impl.begin();
		}

		iterator end() BOOST_NOEXCEPT
		{
			return m_impl.end();
		}

		const_iterator end() const BOOST_NOEXCEPT
		{
			return m_impl.end();
		}

		template <class ...Args>
		void emplace_back(Args &&...args)
		{
			m_impl.emplace_back(std::forward<Args>(args)...);
		}

	private:

		boost::container::vector<Element, Allocator> m_impl;

		explicit vector(boost::container::vector<Element, Allocator> impl)
			: m_impl(std::move(impl))
		{
		}
	};

	template <class Element, class Allocator>
	bool operator == (vector<Element, Allocator> const &left, vector<Element, Allocator> const &right)
	{
		return (left.size() == right.size()) && std::equal(left.begin(), left.end(), right.begin());
	}
}

#endif

{'fraction_non_alphanumeric': 0.13388822829964328, 'fraction_numerical': 0.001426872770511296, 'mean_word_length': 4.135531135531136, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 31, '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': '3667142', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1464, 'n_words': 294}