$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Noel Belcourt (kbelco_at_[hidden])
Date: 2006-02-25 00:36:54
On Feb 24, 2006, at 4:00 PM, Andy Little wrote:
>
> "Paul Mensonides" wrote
>> There is a dinstinction between types on which metaprogramming 
>> operates (such
>> as
>> 'int' or 'const MyClass') and the types of metaprogramming constructs
>> themselves.  The latter need only be structurally compatible with the 
>> concept
>> (i.e. the archtype or the Plutonic form of the structure).  If the 
>> MPL starts
>> making guarantees that metatypes (e.g. a 'vector', a 'list', an 
>> 'int_<A>') can
>> be used as a non-metatype, it will lead to either 1) a combinatorial 
>> explosion
>> of code or 2) a drastic efficiency hit (because the library will be 
>> explicitly
>> rewriting structures after they are built).
>
> I can only go from my experience in pqs where exactly the opposite has 
> happened.
> After my mpl experience which resulted in an unusable library I 
> redesigned the
> library around compile- time meta-constants which can be equality 
> compared using
> is_same. This has dramatically speeded compilation compared with use 
> of mpl (e.g
> 30 secs to 4 sec for a typical compile) And has solved the previous 
> situation
> where VC7.1 compiler gave an out of keys message on relatively trivial 
> test
> cases.
Andy,
I'm just curious but what kind of test are these numbers (30 -> 4 
seconds) measuring?
After buying Dave and Aleksy's MPL book, I went ahead and implemented 
the
quantity<T,D> prototype they proposed to do dimensional analysis, then 
added
unit support, enforcement and conversion, but not automatic conversion 
and
also added support for dimensionless numbers.  I have, in my mind's 
eye, a very
full featured pqs-like system that relies heavily on mpl and I've not 
seen any sort
of compile speed problems like you report.
-- Noel