userver: userver/chaotic/io/std/uint64_t.hpp Source File
Loading...
Searching...
No Matches
uint64_t.hpp
1#pragma once
2
3#include <cstddef>
4
5#include <fmt/format.h>
6
7#include <userver/chaotic/convert/to.hpp>
8#include <userver/utils/numeric_cast.hpp>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace chaotic::convert {
13
14template <typename T>
15std::enable_if_t<std::is_integral_v<T>, T> Convert(const std::uint64_t& value, To<T>) {
16 return utils::numeric_cast<T>(value);
17}
18
19template <typename T>
20std::enable_if_t<std::is_integral_v<T>, std::uint64_t> Convert(const T& value, To<std::uint64_t>) {
21 return utils::numeric_cast<std::uint64_t>(value);
22}
23
24} // namespace chaotic::convert
25
26USERVER_NAMESPACE_END