mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Use shared_ptr instead of unique_ptr for elements.
This allow users to pass it into initializer list. Then clang-format will produce 'acceptable' indentations. This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/18
This commit is contained in:
@@ -42,12 +42,12 @@ class FgColor : public NodeDecorator {
|
||||
Color color_;
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> color(Color c, Element child) {
|
||||
return std::make_unique<FgColor>(unpack(std::move(child)), c);
|
||||
Element color(Color c, Element child) {
|
||||
return std::make_shared<FgColor>(unpack(std::move(child)), c);
|
||||
}
|
||||
|
||||
std::unique_ptr<Node> bgcolor(Color c, Element child) {
|
||||
return std::make_unique<BgColor>(unpack(std::move(child)), c);
|
||||
Element bgcolor(Color c, Element child) {
|
||||
return std::make_shared<BgColor>(unpack(std::move(child)), c);
|
||||
}
|
||||
|
||||
Decorator color(Color c) {
|
||||
|
||||
Reference in New Issue
Block a user