25 constexpr
auto pow10(std::size_t n) {
32 constexpr
unsigned strntou(
const char* str, std::size_t len) {
34 for (
auto i = 0u; i < len; ++i)
35 ret += (str[i] -
'0') *
pow10(len - i - 1);
39 template <
typename Container,
typename T>
unsigned reverse_search(
const Container& c,
const T& e) {
40 const auto it =
std::find(c.begin(), c.end(), e);
41 return static_cast<unsigned>(std::distance(c.begin(), it));
TypePair< T, U > tp
Definition: utils.hpp:19
unsigned reverse_search(const Container &c, const T &e)
Definition: utils.hpp:39
T Type
Definition: utils.hpp:11
T type
Definition: utils.hpp:21
U Second
Definition: utils.hpp:16
constexpr unsigned strntou(const char *str, std::size_t len)
Definition: utils.hpp:32
TypeVal< T > t_
Definition: utils.hpp:12
constexpr auto ti
Definition: utils.hpp:23
constexpr auto pow10(std::size_t n)
Definition: utils.hpp:25
constexpr InputIt find(InputIt first, InputIt last, const T &value)
Definition: cexpr_algs.hpp:4
T First
Definition: utils.hpp:15