2
0
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:
Louis Dionne
2014-07-21 11:06:30 -04:00
parent 22a26fb9b7
commit 653504ebe5
2 changed files with 3 additions and 6 deletions

View File

@@ -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");

View File

@@ -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;
}