<commit_before>#include <iostream>
#include <stdexcept>

using namespace std;

struct X {
	X(int s);
	~X();
private:
	struct def_mem {
		def_mem() {
			def = new int[10];
			clog << "I have constructed def_mem" << endl;
		}
		~def_mem() {
			delete [] def;
			clog << "I have freed def" << endl;
		}
	private:
		int *def;
	};
	def_mem def;
	int sz;
	int *elem;
};

X::X(int s) {
	if (s < 0) { 
		throw invalid_argument("size less than 0");
	}
	sz = s;
	elem = new int[sz];
	clog << "I have constructed X" << endl;
}

X::~X() {
	clog << "I am in ~X() sz = " << sz << endl;
	delete [] elem;
	clog << "I have freed elem" << endl;
}

int main() {
	X x2(10);
	X x3(15);
	try {
		X x1(-10);
	} catch (invalid_argument &ia) {
		clog << "Something Bad!" << endl;
		clog << ia.what() << endl;
	}<commit_msg>Added test member construction order code<commit_after>#include <iostream>
#include <stdexcept>

using namespace std;

struct X {
	X(int s);
	~X();
private:
	struct def_mem {
		def_mem() {
			def = new int[10];
			clog << "I have constructed def_mem" << endl;
		}
		~def_mem() {
			delete [] def;
			clog << "I have freed def" << endl;
		}
	private:
		int *def;
	};
	struct X_sub {
		X_sub() { clog << "I'am in X_sub()" << endl; }
		~X_sub() { clog << "I'am in ~X_sub()" << endl; }
	};
	X_sub xs;
	def_mem def;
	int sz;
	int *elem;
};

X::X(int s) {
	if (s < 0) { 
		throw invalid_argument("size less than 0");
	}
	sz = s;
	elem = new int[sz];
	clog << "I have constructed X" << endl;
}

X::~X() {
	clog << "I am in ~X() sz = " << sz << endl;
	delete [] elem;
	clog << "I have freed elem" << endl;
}

int main() {
	X x2(10);
	X x3(15);
	try {
		X x1(-10);
	} catch (invalid_argument &ia) {
		clog << "Something Bad!" << endl;
		clog << ia.what() << endl;
	}
{'fraction_non_alphanumeric': 0.19715099715099715, 'fraction_numerical': 0.014814814814814815, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 7, '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': '3552369', 'n_tokens_mistral': 808, 'n_tokens_neox': 753, 'n_words': 221}