mirror of
https://github.com/polybar/polybar.git
synced 2025-04-14 17:33:17 -04:00
fix(logger): Wrong conversion function called
For some reason when passing some non-const strings to convert, the convert(T&& arg) method was used instead of the one specialized for strings. This caused an error in clang because you can't pass objects with non-trivial types to varargs functions. The best solution I found was to just add a specialized function for non-const strings.
This commit is contained in:
parent
a45b5d0424
commit
54e2490aa5
2 changed files with 5 additions and 0 deletions
|
@ -100,6 +100,7 @@ class logger {
|
|||
/**
|
||||
* Convert string
|
||||
*/
|
||||
const char* convert(string& arg) const;
|
||||
const char* convert(const string& arg) const;
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,10 @@ POLYBAR_NS
|
|||
/**
|
||||
* Convert string
|
||||
*/
|
||||
const char* logger::convert(string& arg) const {
|
||||
return arg.c_str();
|
||||
}
|
||||
|
||||
const char* logger::convert(const string& arg) const {
|
||||
return arg.c_str();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue