|
Boost : |
From: Rob Stewart (stewart_at_[hidden])
Date: 2005-09-15 16:36:05
From: "Dan McLeran" <dan.mcleran_at_[hidden]>
>
> 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_at_[hidden]> wrote in message
> news:dgcini$ble$1_at_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_at_[hidden] Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk