VCCC
2024.05
VisualCamp Common C++ library
lossless_div.hpp
Go to the documentation of this file.
1
#
/*
2
# * Created by YongGyu Lee on 2020/12/08.
3
# */
4
#
5
# ifndef VCCC_NUMERIC_LOSSLESS_DIV_HPP
6
# define VCCC_NUMERIC_LOSSLESS_DIV_HPP
7
#
8
# include "
vccc/type_traits.hpp
"
9
10
namespace
vccc
{
11
14
22
template
<
typename
T1,
typename
T2>
23
decltype(
auto
)
24
lossless_div
(const T1 a, const T2 b)
25
{
26
using
t =
lossless_type_div<T1, T2>
;
27
return
static_cast<
t
>
(a) /
static_cast<
t
>
(b);
28
}
29
31
32
}
// namespace vccc
33
34
# endif
// VCCC_NUMERIC_LOSSLESS_DIV_HPP
vccc::lossless_div
decltype(auto) lossless_div(const T1 a, const T2 b)
divide without narrowing
Definition:
lossless_div.hpp:24
vccc
Definition:
directory.h:12
vccc::lossless_type_div
Definition:
lossless_type.hpp:93
type_traits.hpp
include
vccc
__numeric
lossless_div.hpp
Generated by
1.9.1