Boost logo

Boost :

Subject: Re: [boost] a safe integer library
From: Brook Milligan (brook_at_[hidden])
Date: 2016-01-12 11:46:36


> On Dec 17, 2015, at 12:16 AM, David Stone <david_at_[hidden] <mailto:david_at_[hidden]>> wrote:
>
> I have written a similar library (http://doublewise.net/c++/bounded/ <http://doublewise.net/c++/bounded/>), and
> I have a few questions about your implementation.

I am curious whether either of you (Robert and David) have handled the need to evaluate the condition “is X (an object of type with some _potentially_ wide range) within bounds of Y (an object of type with some _potentially_ narrow range)? I have use cases in which I would like use bounded types, but there are situations in which I need to capture the result of something like in_range<Y>(x). I am not seeing this in your libraries but perhaps I am missing something. It does seem quite feasible to include and would seem to incur no runtime cost under the same conditions that the construction Y y = {x} would not.

If I am missing this in your libraries, please let me know; otherwise, I throw this out as a suggested addition.

Cheers,
Brook


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk