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
@ -100,6 +100,7 @@ class logger {
|
|||||||
/**
|
/**
|
||||||
* Convert string
|
* Convert string
|
||||||
*/
|
*/
|
||||||
|
const char* convert(string& arg) const;
|
||||||
const char* convert(const string& arg) const;
|
const char* convert(const string& arg) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,6 +13,10 @@ POLYBAR_NS
|
|||||||
/**
|
/**
|
||||||
* Convert string
|
* Convert string
|
||||||
*/
|
*/
|
||||||
|
const char* logger::convert(string& arg) const {
|
||||||
|
return arg.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
const char* logger::convert(const string& arg) const {
|
const char* logger::convert(const string& arg) const {
|
||||||
return arg.c_str();
|
return arg.c_str();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user