Commit 5f42af1d authored by nagayama15's avatar nagayama15

リファクタリング

parent e24262a4
...@@ -21,25 +21,22 @@ namespace ...@@ -21,25 +21,22 @@ namespace
{ {
try try
{ {
if constexpr (std::is_unsigned_v<Integer>) const auto v = [](llvm::StringRef s)
{ {
const auto v = std::stoull(arg.str()); if constexpr (std::is_unsigned_v<Integer>)
if (Min <= v && v <= Max)
{ {
val = static_cast<Integer>(v); return std::stoull(s.str());
return false;
} }
} else
else
{
const auto v = std::stoll(arg.str());
if (Min <= v && v <= Max)
{ {
val = static_cast<Integer>(v); return std::stoll(s.str());
return false;
} }
}(arg);
if (Min <= v && v <= Max)
{
val = static_cast<Integer>(v);
return false;
} }
} }
catch ([[maybe_unused]] const std::exception& e) catch ([[maybe_unused]] const std::exception& e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment