修复c++标准设置不正确,使用新的std::println来输出日志
This commit is contained in:
@@ -41,11 +41,11 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
for (const char* test_str : test_cases) {
|
||||
std::optional<linear_color> color = linear_color::from_string(test_str);
|
||||
std::cout << "Parsing '" << test_str << "': ";
|
||||
std::println(std::cout, "Parsing '{}': ", test_str);
|
||||
if (color) {
|
||||
std::cout << "Success -> r:" << color->r << " g:" << color->g << " b:" << color->b << " a:" << color->a << std::endl;
|
||||
std::println(std::cout, "Success -> r:{}, g:{}, b:{}, a:{}", color->r, color->g, color->b, color->a);
|
||||
} else {
|
||||
std::cout << "Failed" << std::endl;
|
||||
std::println(std::cerr, "Failed to parse color string: {}", test_str);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,29 +70,33 @@ int main(int argc, char* argv[]) {
|
||||
const auto& text_block2 = std::make_shared<mtext_block>();
|
||||
text_block2->set_text(U"Hello, World!");
|
||||
|
||||
const auto button = mnew(mbutton)
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
.visibility(visibility_t::visible)
|
||||
[
|
||||
text_block
|
||||
];
|
||||
auto button = std::make_shared<mbutton>();
|
||||
button->push_slot(
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
.visibility(visibility_t::visible)
|
||||
[
|
||||
text_block
|
||||
]
|
||||
);
|
||||
|
||||
const auto button2 = mnew(mbutton)
|
||||
mslot(mbutton)
|
||||
.visibility(visibility_t::visible)
|
||||
[
|
||||
text_block2
|
||||
];
|
||||
// const auto button2 = mnew(mbutton)
|
||||
// mslot(mbutton)
|
||||
// .visibility(visibility_t::visible)
|
||||
// [
|
||||
// text_block2
|
||||
// ];
|
||||
|
||||
const auto& window = mwindow::create({ 800, 600 }, L"Hello, World!");
|
||||
window->set_content(
|
||||
mnew(mborder)
|
||||
mslot(mborder)
|
||||
.h_alignment(horizontal_alignment_t::center)
|
||||
.v_alignment(vertical_alignment_t::center)
|
||||
mborder()
|
||||
[
|
||||
button
|
||||
mslot(mborder)
|
||||
.h_alignment(horizontal_alignment_t::center)
|
||||
.v_alignment(vertical_alignment_t::center)
|
||||
[
|
||||
button
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user