<commit_before>#ifndef ATOMIC_H
#define ATOMIC_H
#include <boost/utility.hpp>

namespace l7vs{

template<class T> class atomic :boost::noncopyable{
protected:
	volatile T p;
public:
	T get(){ return p; }
	atomic& operator=(const T& q) {
		__sync_lock_test_and_set(&p,q);
		return *this;
	}
	atomic& operator++(const int){
		p++;
		return *this;
	}
	atomic& operator--(const int){
		p--;
		return *this;
	}
	atomic& operator+=(const T& q){
		p += q;
		return *this;
	}
	atomic& operator-=(const T& q){
		p -= q;
		return *this;
	}
	bool operator<(  T& q ) const{ return p < q; }
	bool operator<=( T& q ) const{ return p <= q; }
	bool operator>(  T& q ) const{ return p > q; }
	bool operator>=( T& q ) const{ return p >= q; }
	bool operator==( T& q ) const{ return p == q; }
	bool operator!=( T& q ) const{ return p != q; }
};


//int
template <>
class atomic<int>{
protected:
	volatile int p;
public:
	int get(){
		return p;
	}
	atomic& operator=(const int& q) {
		__sync_lock_test_and_set(&p,q);
		return *this;
	}
	atomic& operator++(const int){
		__sync_add_and_fetch(&p,1);
		return *this;
	}
	atomic& operator--(const int){
		__sync_sub_and_fetch(&p,1);
		return *this;
	}
	atomic& operator+=(const int& q){
		__sync_add_and_fetch(&p,q);
		return *this;
	}
	atomic& operator-=(const int& q){
		__sync_sub_and_fetch(&p,q);
		return *this;
	}
	bool operator<(  const int& q ) const{ return p < q; }
	bool operator<=( const int& q ) const{ return p <= q; }
	bool operator>(  const int& q ) const{ return p > q; }
	bool operator>=( const int& q ) const{ return p >= q; }
	bool operator==( const int& q ) const{ return p == q; }
	bool operator!=( const int& q ) const{ return p != q; }
};


//longlong
template <>
class atomic<long long>{
protected:
	volatile long long p;
public:
	long long get(){
		return p;
	}
	atomic& operator=(const long long& q) {
		__sync_lock_test_and_set(&p,q);
		return *this;
	}
	atomic& operator++(const int){
		__sync_add_and_fetch(&p,1);
		return *this;
	}
	atomic& operator--(const int){
		__sync_sub_and_fetch(&p,1);
		return *this;
	}
	atomic& operator+=(const long long& q){
		__sync_add_and_fetch(&p,q);
		return *this;
	}
	atomic& operator-=(const long long& q){
		__sync_sub_and_fetch(&p,q);
		return *this;
	}
	bool operator<(  const long long& q ) const{ return p < q; }
	bool operator<=( const long long& q ) const{ return p <= q; }
	bool operator>(  const long long& q ) const{ return p > q; }
	bool operator>=( const long long& q ) const{ return p >= q; }
	bool operator==( const long long& q ) const{ return p == q; }
	bool operator!=( const long long& q ) const{ return p != q; }
};

//unsigned longlong
template <>
class atomic<unsigned long long>{
	protected:
		volatile unsigned long long  p;
	public:
		unsigned long long get(){
			return p;
		}
		atomic& operator=(const unsigned long long& q) {
			__sync_lock_test_and_set(&p,q);
			return *this;
		}
		atomic& operator++(const int){
			__sync_add_and_fetch(&p,1);
			return *this;
		}
		atomic& operator--(const int){
			__sync_sub_and_fetch(&p,1);
			return *this;
		}
		atomic& operator+=(const unsigned long long& q){<commit_msg>mutableの追加<commit_after>#ifndef ATOMIC_H
#define ATOMIC_H
#include <boost/utility.hpp>

namespace l7vs{

template<class T> class atomic :boost::noncopyable{
protected:
	mutable volatile T p;
public:
	explicit atomic() : p( 0 ) {} 

	T get(){ return p; }
	atomic& operator=(const T& q) {
		__sync_lock_test_and_set(&p,q);
		return *this;
	}
	atomic& operator++(const int){
		p++;
		return *this;
	}
	atomic& operator--(const int){
		p--;
		return *this;
	}
	atomic& operator+=(const T& q){
		p += q;
		return *this;
	}
	atomic& operator-=(const T& q){
		p -= q;
		return *this;
	}
	bool operator<(  T& q ) const{ return p < q; }
	bool operator<=( T& q ) const{ return p <= q; }
	bool operator>(  T& q ) const{ return p > q; }
	bool operator>=( T& q ) const{ return p >= q; }
	bool operator==( T& q ) const{ return p == q; }
	bool operator!=( T& q ) const{ return p != q; }
};


//int
template <>
class atomic<int>{
protected:
	mutable volatile int p;
public:
	int get(){
		return p;
	}
	atomic& operator=(const int& q) {
		__sync_lock_test_and_set(&p,q);
		return *this;
	}
	atomic& operator++(const int){
		__sync_add_and_fetch(&p,1);
		return *this;
	}
	atomic& operator--(const int){
		__sync_sub_and_fetch(&p,1);
		return *this;
	}
	atomic& operator+=(const int& q){
		__sync_add_and_fetch(&p,q);
		return *this;
	}
	atomic& operator-=(const int& q){
		__sync_sub_and_fetch(&p,q);
		return *this;
	}
	bool operator<(  const int& q ) const{ return p < q; }
	bool operator<=( const int& q ) const{ return p <= q; }
	bool operator>(  const int& q ) const{ return p > q; }
	bool operator>=( const int& q ) const{ return p >= q; }
	bool operator==( const int& q ) const{ return p == q; }
	bool operator!=( const int& q ) const{ return p != q; }
};


//longlong
template <>
class atomic<long long>{
protected:
	mutable volatile long long p;
public:
	long long get(){
		return p;
	}
	atomic& operator=(const long long& q) {
		__sync_lock_test_and_set(&p,q);
		return *this;
	}
	atomic& operator++(const int){
		__sync_add_and_fetch(&p,1);
		return *this;
	}
	atomic& operator--(const int){
		__sync_sub_and_fetch(&p,1);
		return *this;
	}
	atomic& operator+=(const long long& q){
		__sync_add_and_fetch(&p,q);
		return *this;
	}
	atomic& operator-=(const long long& q){
		__sync_sub_and_fetch(&p,q);
		return *this;
	}
	bool operator<(  const long long& q ) const{ return p < q; }
	bool operator<=( const long long& q ) const{ return p <= q; }
	bool operator>(  const long long& q ) const{ return p > q; }
	bool operator>=( const long long& q ) const{ return p >= q; }
	bool operator==( const long long& q ) const{ return p == q; }
	bool operator!=( const long long& q ) const{ return p != q; }
};

//unsigned longlong
template <>
class atomic<unsigned long long>{
	protected:
		mutable volatile unsigned long long  p;
	public:
		unsigned long long get(){
			return p;
		}
		atomic& operator=(const unsigned long long& q) {
			__sync_lock_test_and_set(&p,q);
			return *this;
		}
		atomic& operator++(const int){
			__sync_add_and_fetch(&p,1);
			return *this;
		}
		atomic& operator--(const int){
			__sync_sub_and_fetch(&p,1);
			return *this;
		}
		atomic& operator+=(const unsigned long long& q){
{'fraction_non_alphanumeric': 0.1593996840442338, 'fraction_numerical': 0.002369668246445498, 'mean_word_length': 3.814448669201521, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '7439051', 'n_tokens_mistral': 2503, 'n_tokens_neox': 2379, 'n_words': 735}