Boost logo

Boost Users :

Subject: Re: [Boost-users] Dynamically creating new units
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-12-26 14:48:41

On Sat, Dec 26, 2009 at 12:16 AM, Brandon Olivares
<programmer2188_at_[hidden]> wrote:
> On 2009-12-26, OvermindDL1 wrote:
>> You could just auto it.  :)
>>   BOOST_AUTO(v, l/t);
>> Then you do not need to bother figuring out what type it is, although it
>> is your light_year_per_hour, although maybe a little more efficient
>> representation.
>> If you just want the type of an expression like l/t if you want to
>> typedef it or something, then you can use BOOST_TYPEOF.  It is all in
>> the documentation.  :) _______________________________________________
> Oh that's perfect; that has solved my problem! Thank you very much, and it only took 5 seconds to compile.

Yeah, I guess I should have thought of that earlier. I use BOOST_AUTO
and BOOST_TYPEOF rather often actually since it can cut down on
template instancing pretty dramatically in some libraries.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at