userver: userver/chaotic/io/std/uint32_t.hpp Source File
Loading...
Searching...
No Matches
uint32_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::uint32_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::uint32_t> Convert(const T& value, To<std::uint32_t>) {
21 return utils::numeric_cast<std::uint32_t>(value);
22}
23
24} // namespace chaotic::convert
25
26USERVER_NAMESPACE_END