|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Whether From may become a constant Prop<To>: an implicit conversion that does not silently change the kind of value. More...
#include <view.hpp>
Whether From may become a constant Prop<To>: an implicit conversion that does not silently change the kind of value.
Two implicit conversions are refused because they compile and then show something else. A pointer, a string literal included, converts to bool as "not null", so Prop<bool>{"false"} would be true. A floating-point value converts to an integral type by truncation, so Prop<std::int64_t>{2.9} would be 2. Other narrowing, such as int to std::size_t, is kept: Prop<std::size_t> count = 0 is the ordinary way to write a count.
From is the source type as deduced for a forwarding reference; To is the property's value type.