
This could be checked at compile-time. I personally don't want to pursue this path. I'd rather leave it up to the developer to specify the type of the result value of this addition. "Rob Stewart" <stewart@sig.com> wrote in message news:200509152136.j8FLa52H011209@shannonhoon.balstatdev.susq.com...
From: "Dan McLeran" <dan.mcleran@seagate.com>
template<typename T1, typename T2> struct AdditionTypeResolver { typedef typename CheckedIntegralValue<T1::min + T2::min, T1::max + T2::max> type; };
typedef CheckedIntegralValue<int, -10, 100> Type1; typedef CheckedIntegralValue<int, -100, 20> Type2; Type1 a = -10; Type2 b = -100; AdditionTypeResolver<Type1, Type2 >::type c = a + b;
What if T1::min and T2::min, for example, have different signs?
"michael toksvig" <michaeltoksvig@yahoo.com> wrote in message news:dgcini$ble$1@sea.gmane.org... [big snip]
Please have a look at http://www.boost.org/more/discussion_policy.htm#effective, particularly the parts on overquoting and quotation style.
-- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer; _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost