Using the cstdint header portably can be quite a challenge (it is missing from some MSVC implementations). At the same time numeric_limits::max() can be hard to use without constexpr and it is not actually required to work with uint64_t. If you don’t care about those things too much, std::numeric_limits<uint64_t>::max() will most likely do the trick.
Boost.Integer has an implementation of cstdint and comes with an extra traits class to get a constant maximal value. A compliant implementation of cstdint should also provide the macro UINT64_MAX, but I’m not sure about boost.