<commit_before>#ifndef MUE__GUEST_TUPLE_GENERATOR
#define MUE__GUEST_TUPLE_GENERATOR


#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <cassert>

#include "config.h"


namespace mue {


class Guest_tuple_generator
{
	public:
		typedef std::pair<Team_id, Team_id> GuestPair;

	private:
		typedef std::vector<Team_id>::const_iterator  Team_iterator;

		std::vector<Team_id> _possible_guests;
		Team_iterator _guest_end;

	public:
		class Iterator  : public std::iterator<std::input_iterator_tag, GuestPair> {
			private:
				friend class Guest_tuple_generator;

				Team_iterator        _guest_a;
				Team_iterator        _guest_b;
				Team_iterator const& _end;

				Iterator(Team_iterator const& start, Team_iterator const& end)
				:
					_guest_a(start),
					_guest_b(start == end ? end : start + 1),
					_end(end)
				{}

			public:

				Iterator(Iterator const& other)
				: _guest_a(other._guest_a), _guest_b(other._guest_b), _end(other._end)
				{}

				inline Iterator& operator++()
				{
					assert(_guest_a != _end);
					assert(_guest_b != _end);

					++_guest_b;
					if (_guest_b == _end) {
						++_guest_a;
						if (_guest_a == _end)
							_guest_b = _end;
						else {
							_guest_b = _guest_a + 1;
							if (_guest_b == _end)
								_guest_a = _end;
						}
					}
					return *this;
				}

				inline Iterator operator++(int)
				{
					Iterator tmp(*this);
					++(*this);
					return tmp;
				}

				inline bool operator== (Iterator const& other) const { return (_guest_a == other._guest_a) && (_guest_b == other._guest_b); }
				inline bool operator!= (Iterator const& other) const { return !(*this == other); }

				inline GuestPair operator* ()
				{
					assert(_guest_a != _end);
					assert(_guest_b != _end);
					return GuestPair(*_guest_a, *_guest_b);
				}

		};

		typedef Iterator iterator;

		Guest_tuple_generator(std::vector<Team_id> const& guests, std::unordered_set<Team_id> const& used);

		iterator begin() { return Iterator(_possible_guests.begin(), _guest_end); }

		iterator end() { return Iterator(_guest_end, _guest_end); }
};

std::ostream& operator<< (std::ostream& os, Guest_tuple_generator::GuestPair const& p);
}

#endif<commit_msg>Chnage constness in Guest_tuple_generator<commit_after>#ifndef MUE__GUEST_TUPLE_GENERATOR
#define MUE__GUEST_TUPLE_GENERATOR


#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <cassert>
#include <iostream>

#include "config.h"


namespace mue {


class Guest_tuple_generator
{
	public:
		typedef std::pair<Team_id, Team_id> GuestPair;

	private:
		typedef std::vector<Team_id>::const_iterator  Team_iterator;

		std::vector<Team_id> _possible_guests;
		Team_iterator _guest_end;

	public:
		class Iterator  : public std::iterator<std::input_iterator_tag, const GuestPair> {
			private:
				friend class Guest_tuple_generator;

				Team_iterator        _guest_a;
				Team_iterator        _guest_b;
				Team_iterator const& _end;

				Iterator(Team_iterator const& start, Team_iterator const& end)
				:
					_guest_a(start),
					_guest_b(start == end ? end : start + 1),
					_end(end)
				{}

			public:

				Iterator(Iterator const& other)
				: _guest_a(other._guest_a), _guest_b(other._guest_b), _end(other._end)
				{}

				inline Iterator& operator++()
				{
					assert(_guest_a != _end);
					assert(_guest_b != _end);

					++_guest_b;
					if (_guest_b == _end) {
						++_guest_a;
						if (_guest_a == _end)
							_guest_b = _end;
						else {
							_guest_b = _guest_a + 1;
							if (_guest_b == _end)
								_guest_a = _end;
						}
					}
					return *this;
				}

				inline Iterator operator++(int)
				{
					Iterator tmp(*this);
					++(*this);
					return tmp;
				}

				inline bool operator== (Iterator const& other) const { return (_guest_a == other._guest_a) && (_guest_b == other._guest_b); }
				inline bool operator!= (Iterator const& other) const { return !(*this == other); }

				inline const GuestPair operator* ()
				{
					assert(_guest_a != _end);
					assert(_guest_b != _end);
					return GuestPair(*_guest_a, *_guest_b);
				}

		};

		typedef Iterator iterator;

		Guest_tuple_generator(std::vector<Team_id> const& guests, std::unordered_set<Team_id> const& used);

		iterator begin() const { return Iterator(_possible_guests.begin(), _guest_end); }

		iterator end() const { return Iterator(_guest_end, _guest_end); }
};

std::ostream& operator<< (std::ostream& os, Guest_tuple_generator::GuestPair const& p);
}

#endif
{'fraction_non_alphanumeric': 0.12268722466960352, 'fraction_numerical': 0.000881057268722467, 'mean_word_length': 3.469488188976378, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 26, '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': '6412237', 'n_tokens_mistral': 2034, 'n_tokens_neox': 1597, 'n_words': 338}