<commit_before>#ifndef TURBO_CONTAINER_TRIE_KEY_HPP
#define TURBO_CONTAINER_TRIE_KEY_HPP

#include <cstdint>
#include <cmath>
#include <iterator>
#include <limits>
#include <tuple>
#include <turbo/math/const_expr.hpp>
#include <turbo/toolset/extension.hpp>

namespace turbo {
namespace container {

template <class uint_t, std::size_t radix>
class uint_trie_key_tester;

template <class uint_t, std::size_t radix>
class uint_trie_key
{
public:
    typedef uint_t uint_type;
    static_assert(!std::numeric_limits<uint_type>::is_signed, "uint_t template parameter must be an unsigned integral");
    enum class write_result
    {
	success = 0U,
	out_of_bounds
    };
    enum class read_result
    {
	success = 0U,
	out_of_bounds
    };
    enum class get_result
    {
	success = 0U,
	unavailable
    };
    static constexpr std::size_t key_bit_size()
    {
	return sizeof(uint_type) * 8U;
    }
    static constexpr std::size_t radix_bit_size()
    {
	return std::llround(std::log2(radix) / std::log2(2U));
    }
    static constexpr std::size_t max_prefix_capacity()
    {
	return key_bit_size() / radix_bit_size();
    }
    class iterator : public std::forward_iterator_tag
    {
    public:
	typedef uint_type value_type;
	typedef uint_type* pointer;
	typedef uint_type& reference;
	typedef std::ptrdiff_t difference_type;
	typedef std::bidirectional_iterator_tag iterator_category;
	typedef std::uint8_t index_type;
	inline iterator()
	    :
		index_(0U)
	{ }
	inline explicit iterator(index_type index)
	    :
		index_(index)
	{ }
	iterator(const iterator& other)
	    :
		index_(other.index_)
	{ }
	~iterator() = default;
	iterator& operator=(const iterator& other)
	{
	    if (this != &other)
	    {
		index_ = other.index_;
	    }
	    return *this;
	}
	inline bool operator==(const iterator& other) const
	{
	    return (!is_valid() && !other.is_valid()) || index_ == other.index_;
	}
	inline bool operator!=(const iterator& other) const
	{
	    return !(*this == other);
	}
	inline iterator operator+(index_type quantity) const
	{
	    return iterator(index_ + quantity);
	}
	value_type& operator*() = delete;
	value_type* operator->() = delete;
	inline iterator& operator+=(index_type quantity)
	{
	    index_ += quantity;
	    return *this;
	}
	inline iterator& operator++()
	{
	    index_ += 1U;
	    return *this;
	}
	inline iterator operator++(int)
	{
	    iterator tmp(*this);
	    ++(*this);
	    return tmp;
	}
	inline bool is_valid() const
	{
	    return index_ < max_prefix_capacity();
	}
	inline bool is_min_index() const
	{
	    return index_ == 0U;
	}
	inline bool is_max_index() const
	{
	    return index_ == (max_prefix_capacity() - 1U);
	}
	inline index_type get_index() const
	{
	    return index_;
	}
    private:
	index_type index_;
    };
    inline explicit uint_trie_key(uint_type key)
	:
	    key_(key)
    { }
    inline uint_trie_key()
	:
	    key_(0U)
    { }
    inline uint_trie_key(const uint_trie_key& other) = default;
    ~uint_trie_key() = default;
    uint_trie_key& operator=(const uint_trie_key& other) = default;
    inline iterator begin() const
    {
	return iterator(0U);
    }
    static constexpr iterator end()<commit_msg>adding a copy member function<commit_after>#ifndef TURBO_CONTAINER_TRIE_KEY_HPP
#define TURBO_CONTAINER_TRIE_KEY_HPP

#include <cstdint>
#include <cmath>
#include <iterator>
#include <limits>
#include <tuple>
#include <turbo/math/const_expr.hpp>
#include <turbo/toolset/extension.hpp>

namespace turbo {
namespace container {

template <class uint_t, std::size_t radix>
class uint_trie_key_tester;

template <class uint_t, std::size_t radix>
class uint_trie_key
{
public:
    typedef uint_t uint_type;
    static_assert(!std::numeric_limits<uint_type>::is_signed, "uint_t template parameter must be an unsigned integral");
    enum class write_result
    {
	success = 0U,
	out_of_bounds
    };
    enum class read_result
    {
	success = 0U,
	out_of_bounds
    };
    enum class get_result
    {
	success = 0U,
	unavailable
    };
    static constexpr std::size_t key_bit_size()
    {
	return sizeof(uint_type) * 8U;
    }
    static constexpr std::size_t radix_bit_size()
    {
	return std::llround(std::log2(radix) / std::log2(2U));
    }
    static constexpr std::size_t max_prefix_capacity()
    {
	return key_bit_size() / radix_bit_size();
    }
    class iterator : public std::forward_iterator_tag
    {
    public:
	typedef uint_type value_type;
	typedef uint_type* pointer;
	typedef uint_type& reference;
	typedef std::ptrdiff_t difference_type;
	typedef std::bidirectional_iterator_tag iterator_category;
	typedef std::uint8_t index_type;
	inline iterator()
	    :
		index_(0U)
	{ }
	inline explicit iterator(index_type index)
	    :
		index_(index)
	{ }
	iterator(const iterator& other)
	    :
		index_(other.index_)
	{ }
	~iterator() = default;
	iterator& operator=(const iterator& other)
	{
	    if (this != &other)
	    {
		index_ = other.index_;
	    }
	    return *this;
	}
	inline bool operator==(const iterator& other) const
	{
	    return (!is_valid() && !other.is_valid()) || index_ == other.index_;
	}
	inline bool operator!=(const iterator& other) const
	{
	    return !(*this == other);
	}
	inline iterator operator+(index_type quantity) const
	{
	    return iterator(index_ + quantity);
	}
	value_type& operator*() = delete;
	value_type* operator->() = delete;
	inline iterator& operator+=(index_type quantity)
	{
	    index_ += quantity;
	    return *this;
	}
	inline iterator& operator++()
	{
	    index_ += 1U;
	    return *this;
	}
	inline iterator operator++(int)
	{
	    iterator tmp(*this);
	    ++(*this);
	    return tmp;
	}
	inline bool is_valid() const
	{
	    return index_ < max_prefix_capacity();
	}
	inline bool is_min_index() const
	{
	    return index_ == 0U;
	}
	inline bool is_max_index() const
	{
	    return index_ == (max_prefix_capacity() - 1U);
	}
	inline index_type get_index() const
	{
	    return index_;
	}
    private:
	index_type index_;
    };
    inline explicit uint_trie_key(uint_type key)
	:
	    key_(key)
    { }
    inline uint_trie_key()
	:
	    key_(0U)
    { }
    inline uint_trie_key(const uint_trie_key& other) = default;
    ~uint_trie_key() = default;
    uint_trie_key& operator=(const uint_trie_key& other) = default;
    inline uint_trie_key& copy(const uint_trie_key& other, const iterator& from, const iterator& to)
    {
	for (iterator iter = from; iter != to; ++iter)
	{
	    if (iter.is_valid())
	    {
		this->write(iter, std::get<1>(other.read(iter)));
	    }
	}
	return *this;
    }
    inline iterator begin() const
    {
	return iterator(0U);
    }
    static constexpr iterator end()
{'fraction_non_alphanumeric': 0.11544250451535219, 'fraction_numerical': 0.0043648404575556896, 'mean_word_length': 3.617790132036136, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 27, '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': '7119579', 'n_tokens_mistral': 2431, 'n_tokens_neox': 2310, 'n_words': 535}