di
0.1.0
Loading...
Searching...
No Matches
divide_round_up.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
di/function/curry_back.h
"
4
#include "
di/meta/language.h
"
5
#include "
di/meta/util.h
"
6
7
namespace
di::math
{
8
namespace
detail {
9
struct
DivideRoundUpFunction {
10
template
<concepts::Integer T>
11
constexpr
auto
operator()(T a,
meta::TypeIdentity<T>
b)
const
-> T {
12
return
(a + b - 1) / b;
13
}
14
};
15
}
16
17
constexpr
inline
auto
divide_round_up
=
function::curry_back
(detail::DivideRoundUpFunction {},
meta::c_<2ZU>
);
18
}
19
20
namespace
di
{
21
using
math::divide_round_up
;
22
}
curry_back.h
language.h
di::function::curry_back
constexpr auto curry_back
Definition
curry_back.h:141
di::math
Definition
abs.h:10
di::math::divide_round_up
constexpr auto divide_round_up
Definition
divide_round_up.h:17
di::meta::TypeIdentity
Type< TypeConstant< T > > TypeIdentity
This is a helper template to prevent C++ from deducing the type of template argument.
Definition
core.h:32
di::meta::c_
constexpr auto c_
A value of type Constexpr<val>.
Definition
constexpr.h:252
di
Definition
any_storable.h:9
util.h
di
math
divide_round_up.h
Generated by
1.13.2