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,
16 To<T>) {
17 return utils::numeric_cast<T>(value);
18}
19
20template <typename T>
21std::enable_if_t<std::is_integral_v<T>, std::uint64_t> Convert(
22 const T& value, To<std::uint64_t>) {
23 return utils::numeric_cast<std::uint64_t>(value);
24}
25
26} // namespace chaotic::convert
27
28USERVER_NAMESPACE_END