teslamotors / fixed-containers

C++ Fixed Containers
MIT License
395 stars 38 forks source link

[OptionalRef] Explicit ctor, deleted r-value ctor #117

Closed younesr1 closed 5 months ago

younesr1 commented 5 months ago

A bug was identified where assigning OptionalRef to T was allowed since it would use the implicit ctor and promote to OptionalRef and assign through that. The solution is to make the ctor explicit

Another bug was identified where passing in r-value into the T& ctor is allowed if T is const. The solution is to explcitly delete the r-value ctor