Robert:<br /> <br />&gt;First, I hope that you are aware of the issues with using floating point types<br />&gt;with this library. If not, please read the rationale section of the<br />&gt;documentation and the discussion in the related thread on the developers&#39; list.<br />Yup, been following.  You did a good job of educating me on a previous post... I think I understand the issue now, but don&#39;t really have much of an option.  As far as I can undestand from the discussions, this is a general problem with equality operations with floating points and has nothing to do with your library.  If this is true, I would change the &quot;rationale&quot; section to say that the mess is not your fault and it isn&#39;t a library problem and that you need to be just as careful as you would normally.<br /><br />&gt;The constraint could look like this (written out of my head, not tested):<br />If this is possible, I am very happy.  It looks like it is.<br />The only other things that I would say need to be thought through in the design is unions of constraints instead of just intersections of them.  For example, I was checking this out a while back, and it manages the sets of intervals/etc. well: http://www.herold-faulhaber.de/itl/<br />I would wonder if formalizing intervals in this library (or using another) is a good way to deal with different bounds... but that is beyond my level of competence.<br /><br />&gt; Why not just use numeric_limits&lt;risk_aversion::value_type&gt;?<br />1) Because I was too stupid to think of that, and <br />2) Because I want to be able to write generic functions such as:<br />template&lt;typename T&gt;<br />bool is_NaN(T& t)<br />{<br />  return (t == std::numeric_limits&lt; T &gt;::quiet_NaN());<br />}<br /><br />Again, my idea is that I want to be able to throw around elements of constrained types to generic functions and all of the standard types of things I would do with the superset type.<br /><br />      <br />&gt;Actually, only the mutating operators (++, --, =, += etc.) are overloaded. For<br />&gt;I don&#39;t think this is needed. If you write:<br />&gt;        constrained&lt;int&gt; x, y, z;<br />&gt;        z = x + y;<br />&gt;Then simply the + operator for int is used.<br />Even better.  As long as it works for all of the auto conversions between intrinsic types we are also in business. e.g. <br />constrained&lt;int&gt; x, y, z;<br />double c;<br />z = c * x + y;<br /><br /><br />Thanks Robert.  Great library, time for me to submit a glowing review.