teslamotors / fixed-containers

C++ Fixed Containers
MIT License
352 stars 31 forks source link

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

Closed younesr1 closed 4 weeks ago

younesr1 commented 1 month 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