/* Row */
struct T_cash_account_row {

    // Fields:
    enum T_field_enum { amount_of_money_e, gender_e, age_e, code_e, height_e,   /*<<<<<- add fields here (with index) */
		last_e /*<<<<<- add included fields here (without index) */
	};
	static_assert(last_e > 0, "Number of indexed fields in enum of T_user_row must be greater than 0!");

    	unsigned code:20;			// 0 - 1000000
	unsigned gender:1;			// 0 - 1
	unsigned age:7;			// 0 - 100	
	unsigned amount_of_money:20;	// 0 - 1000000
	int height;				// 0 – 300

	// Get field value
	template<int field_enum> inline unsigned get_field_value();
	template<int field_enum> inline int get_field_value();

	static_assert(5 == last_e, "Add/delete new field-case and correct this assert!");
};

template<> inline unsigned 	T_cash_account_row::get_field_value<T_cash_account_row::code_e>() { return code; }
template<> inline unsigned 	T_cash_account_row::get_field_value<T_cash_account_row::gender_e>() { return gender; }
template<> inline unsigned 	T_cash_account_row::get_field_value<T_cash_account_row::age_e>() { return age; }
template<> inline unsigned 	T_cash_account_row::get_field_value<T_cash_account_row::amount_of_money_e>() { return amount_of_money; }
template<> inline int 
	T_cash_account_row::get_field_value<T_cash_account_row::height_e>() { return height; }
template<> inline unsigned 	T_cash_account_row::get_field_value<T_cash_account_row::last_e>() { return 1; }
/* ----------------------------------------------------------------------- */

int main() {
    T_cash_account_row *row = new T_cash_account_row;
    auto code = row->get_field_value<T_cash_account_row::code_e>();
    
    return 0;
}
