BAN: Formatter now uses perfect forwarding on its arguments

This commit is contained in:
Bananymous
2023-03-08 21:31:26 +02:00
parent 3ac99f1bd8
commit 371dfe8ef3
8 changed files with 175 additions and 155 deletions

View File

@@ -16,7 +16,7 @@ struct framebuffer_info_t
uint8_t bpp;
uint8_t type;
uint8_t color_info[6];
} __attribute__((packed));
};
struct multiboot_memory_map_t
{
@@ -51,7 +51,7 @@ struct multiboot_info_t
uint16_t vbe_interface_off;
uint16_t vbe_interface_len;
framebuffer_info_t framebuffer;
} __attribute__((packed));
};
extern "C" multiboot_info_t* g_multiboot_info;
extern "C" uint32_t g_multiboot_magic;

View File

@@ -54,6 +54,27 @@ ParsedCommandLine ParseCommandLine()
return result;
}
struct Test
{
Test() { dprintln("construct (default)"); }
Test(const Test&) { dprintln("construct (copy)"); }
Test(Test&&) { dprintln("construct (move)"); }
~Test() { dprintln("destruct"); }
Test& operator=(const Test&) { dprintln("assign (copy)"); return *this; }
Test& operator=(Test&&) { dprintln("assign (move)"); return *this; }
};
namespace BAN::Formatter
{
template<typename F>
void print_argument(F putc, const Test& test, const ValueFormat& format)
{
print_argument(putc, &test, format);
}
}
extern "C" void kernel_main()
{
using namespace Kernel;