#ifndef BZOOK_UTILITY_H
#define BZOOK_UTILITY_H

#include <memory>

namespace bzook
{

void check_result(int result, const char *error_context = nullptr);

void throw_error(const char *error_context = nullptr);

template<typename T>
inline void check_result(T resource, const char *error_context = nullptr)
{
   if(!resource)
      check_result(-1, error_context); // Force void check_result(int) to check for an error.
}

}

#endif // BZOOK_UTILITY_H
