Guys, need your opinion on that:
Should non-const types be automatically (implicitly) converted to const types?
This is without implicit non-const to const conversion:
var mut2immut * const Object = const(&Object{})
var immut2mut const * Object = &const(Object{})
var immut2immut const * const Object = const(&const(Object{}))
func NewConstSlice() const [] * const Object {
return [] * const Object {
&const(Object{}),
&const(Object{}),
}
}
This is with implicit non-const to const conversion:
var mut2immut * const Object = &Object{}
var immut2mut const * Object = &Object{}
var immut2immut const * const Object = &Object{}
func NewConstSlice() const [] * const Object {
return [] * const Object {
&Object{},
&Object{},
}
}
Do you think that implicit non-const to const conversion is safe? (bearbeitet)
Как все сложно.
Zver
Roman
Pavel
Dorian
Ευγένιος
Стас
Sergey
Daniel