3 ms·
C++: Checking units at compile time (2003)
- im3w1l 12y agoNice trick. One thing bothers me, couldn't the compiler use operator float and the construct from float for non-matching units?
- coyotebush 12y agoI believe using those together counts as two user-defined conversions and is rejected. But one or both of those might as well be declared explicit.
- BenFrantzDale 12y agoAlso: http://www.boost.org/doc/libs/1_56_0/doc/html/boost_units.html http://www.boost.org/doc/libs/1_56_0/doc/html/boost_units.ht...
- deleted 12y ago[deleted]
- marvy 12y agohere is something harder: http://yosefk.com/blog/can-your-static-type-system-handle-linear-algebra.html http://yosefk.com/blog/can-your-static-type-system-handle-li...
- rsorrel 12y agoStroustrup discusses compile time units (starting at slide 19) in the following presentation: http://ecn.channel9.msdn.com/events/GoingNative12/GN12Cpp11Style.pdf http://ecn.channel9.msdn.com/events/GoingNative12/GN12Cpp11S...