#ifndef PARAMETERCHECKING_H_
#define PARAMETERCHECKING_H_

#include <vector>
#include <functional>
#include "../ExcelDoNotEdit/excel_addin_utils.h"

/*template <typename... ArgTypes>
bool attach_check(
	// pointer to function which checks the args are valid (returns true if they are)
	const std::function<bool(ArgTypes* ...) >& check_func,
	// excel object to attach error messages
	XLOPER12* excel_output,
	// the error message if check_func returns false
	const std::string& err_msg,
	// parameters to test
	ArgTypes*... args
)
{
	bool result = check_func(args...);

	if (!result)
		create_error_message(excel_output, err_msg.c_str());

	return result;
}

template <typename... ArgTypes>
bool attach_check(
	// pointer to function which checks the args are valid 
	// return empty string if valid, error message if not
	const std::function<const std::string (ArgTypes* ...) >& check_func,
	// excel object to attach error messages
	XLOPER12* excel_output,
	// parameters to test
	ArgTypes*... args
)
{
	std::string result = check_func(args...);

	return attach_check(result, excel_output);
}*/

bool attach_check(
	const std::string& error_string,
	XLOPER12* excel_output
);


bool check_inputs(std::vector<std::function< bool() > >& checks_to_perform);

bool check_inputs(std::vector< bool >& checks_to_perform);


bool all_non_negative(bool pass);

template <typename T, typename... ArgTypes>
bool all_non_negative(bool pass, T* number, ArgTypes*... args)
{
	return all_non_negative(*number >= 0 && pass, args...);
}

template <typename... ArgTypes>
bool all_non_negative(ArgTypes*... args)
{
	return all_non_negative(true, args...);
}


#endif
