Winterpixel
3/28/2019 - 12:31 AM

Easy Enum to String

enum OperationType
{
	INSERTION,
	REMOVE,
	SEARCH
};

inline const char* enumToString(const OperationType e)
{
	switch (e)
	{
		case INSERTION: return "Insert()";
		case REMOVE: return "Remove()";
		case SEARCH: return "Search()";
	}

	// Default case
	return nullptr;
}