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

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