mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Make the C++ Value
API a little less error prone
Yesterday I ended up accidentally constructing a Value with a string literal and that turned into a boolean value, resulting in run-time panic. A deleted `const void *` constructor prevents this by producing a compile error instead of picking the boolean constructor.
This commit is contained in:
parent
4fd4ac0754
commit
10189a844c
1 changed files with 1 additions and 0 deletions
|
@ -376,6 +376,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
inline Value(const void *) = delete; // Avoid that for example Value("foo") turns to Value(bool)
|
||||
using ValueOpaque = sixtyfps::cbindgen_private::ValueOpaque;
|
||||
ValueOpaque inner;
|
||||
friend struct Struct;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue