/*
 * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
 */

#pragma once

#include <ox/std/error.hpp>

namespace keel {

[[nodiscard]]
constexpr bool valid(auto const&) noexcept {
	return true;
}

constexpr ox::Error repair(auto const&) noexcept {
	return ox::Error(1, "No repair function for this type");
}

constexpr ox::Error ensureValid(auto &o) noexcept {
	if (!valid(o)) {
		return repair(o);
	}
	return {};
}

}
