1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:37:44 +00:00

AK: Generalise 'PrintfImplementation'

This makes PrintfImplementation usable with any sequence, provided that
a 'next element' function can be written for it.
Does not affect the behaviour of printf() and co.
This commit is contained in:
AnotherTest 2020-08-18 23:07:27 +04:30 committed by Andreas Kling
parent b62043dbca
commit 72edb33670
2 changed files with 194 additions and 111 deletions

View file

@ -40,6 +40,9 @@ inline constexpr unsigned round_up_to_power_of_two(unsigned value, unsigned powe
namespace AK {
template<typename T>
auto declval() -> T;
template<typename T, typename SizeType = decltype(sizeof(T)), SizeType N>
constexpr SizeType array_size(T (&)[N])
{
@ -498,6 +501,7 @@ using AK::array_size;
using AK::ceil_div;
using AK::clamp;
using AK::Conditional;
using AK::declval;
using AK::exchange;
using AK::forward;
using AK::IsBaseOf;