ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.94k stars 418 forks source link

Can not build with g++ 11.2 #520

Closed megahallon closed 1 year ago

megahallon commented 1 year ago

After the fix in #510 I can not build with g++ 11.2, it seems to be caused by the extra braces around the map initializer. This is possibly a compiler bug, it obviously works with various other compilers. The exact version I am using is: g++ (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)

Anyway the extra braces are not needed as far as I can tell.

--- src/ftxui/component/terminal_input_parser.cpp.orig  2022-11-23 11:24:10.374350457 +0100
+++ src/ftxui/component/terminal_input_parser.cpp   2022-11-23 11:24:19.768526030 +0100
@@ -13,7 +13,7 @@
 namespace ftxui {

 // NOLINTNEXTLINE
-const std::map<std::string, std::string> g_uniformize = {{
+const std::map<std::string, std::string> g_uniformize = {
     // Microsoft's terminal uses a different new line character for the return
     // key. This also happens with linux with the `bind` command:
     // See https://github.com/ArthurSonzogni/FTXUI/issues/337
@@ -21,7 +21,7 @@
     {"\r", "\n"},
     // See: https://github.com/ArthurSonzogni/FTXUI/issues/508
     {std::string({8}), std::string({127})},
-}};
+};

 TerminalInputParser::TerminalInputParser(Sender<Task> out)
     : out_(std::move(out)) {}

Originally posted by @megahallon in https://github.com/ArthurSonzogni/FTXUI/issues/510#issuecomment-1324839901

ArthurSonzogni commented 1 year ago

Okay, then we need to revert this part. Thanks for reporting it!

megahallon commented 1 year ago

Note that the change in #510 is fine, but together with the double braces (that were already there) this issue happens.

ArthurSonzogni commented 1 year ago

I think I fixed the issue. Please let me know if I haven't. Thanks for reporting this!

megahallon commented 1 year ago

Thanks it works fine now