maybe a simpler unique_ptr
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
namespace {
|
||||
|
||||
using It = std::istream_iterator<std::string>;
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
auto DivMod(T dividend, T divisor) -> std::pair<T, T>
|
||||
@@ -59,8 +61,7 @@ auto ToInt(std::string const& str) -> T
|
||||
|
||||
auto Solve(std::istream & in) -> std::string
|
||||
{
|
||||
using It = std::istream_iterator<std::string>;
|
||||
return FromInt(std::transform_reduce(It(in), It(), 0, std::plus(), ToInt<std::int64_t>));
|
||||
return FromInt(std::transform_reduce(It{in}, It{}, std::int64_t{}, std::plus(), ToInt<std::int64_t>));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user