mirror of
https://github.com/boostorg/hana.git
synced 2026-02-23 03:42:09 +00:00
Remove more dependencies on <cstddef>
This commit is contained in:
@@ -13,8 +13,6 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/hana/detail/at_index/best.hpp>
|
||||
#include <boost/hana/detail/constexpr.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace boost { namespace hana {
|
||||
namespace functional_detail {
|
||||
@@ -71,7 +69,7 @@ namespace boost { namespace hana {
|
||||
//! Maybe this should be `arg(n)` instead of `arg<n>`? It's more
|
||||
//! consistent but harder to use since we have to write `arg(int_<n>)(...)`
|
||||
//! instead of `arg<n>(...)`.
|
||||
template <std::size_t n>
|
||||
template <decltype(sizeof(int)) n>
|
||||
BOOST_HANA_CONSTEXPR_LAMBDA auto arg = [](auto ...xs) {
|
||||
static_assert(n > 0,
|
||||
"invalid usage of arg with n == 0");
|
||||
|
||||
@@ -15,7 +15,6 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/hana/logical/mcd.hpp>
|
||||
#include <boost/hana/orderable/less_mcd.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
@@ -115,10 +114,10 @@ namespace boost { namespace hana {
|
||||
constexpr int to_int(char c)
|
||||
{ return static_cast<int>(c) - 48; }
|
||||
|
||||
template <std::size_t N>
|
||||
template <decltype(sizeof(int)) N>
|
||||
constexpr long long parse(const char (&arr)[N]) {
|
||||
long long number = 0, base = 1;
|
||||
for (std::size_t i = 0; i < N; ++i) {
|
||||
for (decltype(N) i = 0; i < N; ++i) {
|
||||
number += to_int(arr[N - 1 - i]) * base;
|
||||
base *= 10;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user