From c34b683970dcd7fd9640576833cff1d198af5b7f Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 14 Dec 2020 12:06:39 +0100 Subject: [PATCH] Fix of Slic3r::GUI::format/format_wxstr() for non-const wxString references. Vojtech seemingly does not understand perfect forwarding: Why Slic3r::internal::format::cook(T&& arg) is taken for non-const wxString reference? --- src/slic3r/GUI/format.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/slic3r/GUI/format.hpp b/src/slic3r/GUI/format.hpp index bc6fe7b1b..d7b0256c6 100644 --- a/src/slic3r/GUI/format.hpp +++ b/src/slic3r/GUI/format.hpp @@ -45,6 +45,11 @@ namespace internal { inline const utf8_buffer cook(const wxString &arg) { return utf8_buffer { arg.ToUTF8() }; } + // Vojtech seemingly does not understand perfect forwarding: + // Why Slic3r::internal::format::cook(T&& arg) is taken for non-const wxString reference? + inline const utf8_buffer cook(wxString &arg) { + return utf8_buffer { arg.ToUTF8() }; + } } }