<commit_before>#include <utility>
#include <iostream>
#include <map>

template<
	typename Key_t, 
	typename Value_t,
	typename Predicate_t = std::less<Key_t> >
class non_copyable_map : public std::map<Key_t,Value_t,Predicate_t>
{
  typedef std::map<Key_t,Value_t,Predicate_t> BaseType;

	public:
		non_copyable_map() { }
    
		non_copyable_map(non_copyable_map&& t) : BaseType(std::move(t)) 
		{
		}
    
    non_copyable_map& operator = (non_copyable_map&& t)
		{
			if ( this != &t )
			{
				std::swap<BaseType>(*this,t);
			}
			return *this;
		}
    
	private:
		non_copyable_map(const non_copyable_map&) = delete;
		non_copyable_map& operator = (const non_copyable_map&) = delete;
};

int main(int argc, char* argv[])
{
	non_copyable_map<int, non_copyable_map<int, int> > nestedMap;
	non_copyable_map<int,int> inner;
	inner[3]=4;
	nestedMap[2] = std::move(inner);
	
	auto find_inner = nestedMap.find(2);
	if ( find_inner != nestedMap.end() )
	{
		std::cout << "Found inner map " << std::endl;
	
		auto find_value = find_inner->second.find(3);

		//This HAS to be a reference otherwise compilation fails
		//Failing to compile when accidentally copying maps is the aim
		auto& giveMeAMap = find_inner->second;
		
		giveMeAMap[4] = 7;
		<commit_msg>removed 'delete' as MSVS2010 does not like it<commit_after>#include <utility>
#include <iostream>
#include <map>

template<
	typename Key_t, 
	typename Value_t,
	typename Predicate_t = std::less<Key_t> >
class non_copyable_map : public std::map<Key_t,Value_t,Predicate_t>
{
  typedef std::map<Key_t,Value_t,Predicate_t> BaseType;

	public:
		non_copyable_map() { }
    
		non_copyable_map(non_copyable_map&& t) : BaseType(std::move(t)) 
		{
		}
    
    non_copyable_map& operator = (non_copyable_map&& t)
		{
			if ( this != &t )
			{
				std::swap<BaseType>(*this,t);
			}
			return *this;
		}
    
	private:
		non_copyable_map(const non_copyable_map&);
		non_copyable_map& operator = (const non_copyable_map&);
};

int main(int argc, char* argv[])
{
	non_copyable_map<int, non_copyable_map<int, int> > nestedMap;
	non_copyable_map<int,int> inner;
	inner[3]=4;
	nestedMap[2] = std::move(inner);
	
	auto find_inner = nestedMap.find(2);
	if ( find_inner != nestedMap.end() )
	{
		std::cout << "Found inner map " << std::endl;
	
		auto find_value = find_inner->second.find(3);

		//This HAS to be a reference otherwise compilation fails
		//Failing to compile when accidentally copying maps is the aim
		auto& giveMeAMap = find_inner->second;
		
		giveMeAMap[4] = 7;
		
{'fraction_non_alphanumeric': 0.13402061855670103, 'fraction_numerical': 0.007137192704203013, 'mean_word_length': 4.368085106382979, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 29, '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': '734777', 'n_tokens_mistral': 1047, 'n_tokens_neox': 963, 'n_words': 199}