
Hi,
From: Neal Becker <...> I'm more interested in bound specified at runtime. I believe (without proof) that for many applications there will be little performance difference. I say this because I'm expecting in many (most?) cases the actual integral values will be known to the compiler.
Has any thought been given to adding this? Or, perhaps even making this the default bounded_int, (wrapping_int, etc.) type?
Yes, I'm still thinking about this. The difference between static and run-time bounds is that in the latter case a bounded object needs to store the bounds which makes its size at least 3 times bigger. Another one is that with static bounds many checking operations may be optimised-away or at least inlined. Therefore I'd rather not make run-time bounds the default. I'm working on this as an optional feature, but this is a little bit harder than it seems to unite the two concepts. Best regards, Robert