mirror of
https://github.com/aseprite/aseprite.git
synced 2024-09-02 13:09:27 +00:00
Avoid MSVC issue converting implicitly a string literal (const char*) to bool when assigning to a variant<bool, string, ...>
More information: https://twitter.com/davidcapello/status/1609918634075226121 https://developercommunity.visualstudio.com/t/10242620
This commit is contained in:
parent
3167f8836c
commit
c7864c9fac
@ -69,6 +69,10 @@ namespace doc {
|
||||
template<typename T>
|
||||
Variant(T&& v) : VariantBase(std::forward<T>(v)) { }
|
||||
|
||||
// Avoid using Variant.operator=(const char*) because the "const
|
||||
// char*" is converted to a bool implicitly by MSVC.
|
||||
Variant& operator=(const char*) = delete;
|
||||
|
||||
template<typename T>
|
||||
Variant& operator=(T&& v) {
|
||||
VariantBase::operator=(std::forward<T>(v));
|
||||
|
Loading…
Reference in New Issue
Block a user