You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
479 B
C++

#pragma once
#include "nlohmann/json.hpp"
namespace nsUtils
{
template <typename T>
bool IsWithinTol(T Offset, T Tol)
{
if (Offset > Tol || Offset < -Tol)
{
return false;
}
return true;
}
template <typename T>
inline void getValue(const nlohmann::json& j, const std::string& fieldname, T& value)
{
if (j.contains(fieldname))
{
j.at(fieldname).get_to(value);
}
}
}