Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-10-23 02:20:07


Mohamed Iqbal writes:

> Hi...

Hi Mohamed,

Sorry for the late reply.

> Today I began a serious study of MPL because I will use it for two things:
> 1. to help to develop the game creation tool that I told you about,
> 2. to convert it to Sparks (the programming language of the above tool). Do
> you think that Sparks is a good name?!!
>
> I tried the first example from the MPL paper which was about the "largest"
> metafunction using Dev-C++ that utilizes gcc 3.2. I have some questions:
>
> 1. I am not familiar enough with metaprogramming. What does this example do?

Finds a largest type in a cons-list, e.g.

   largest< cons<char[50],cons<int,nil> > >::type === char[50]

> What do you mean by "largest" type?

The one that has the largest 'sizeof'.

>
> 2. The example compiled and ran fine but the result was strange: I sould get
> the answer as "vector" but what I got is:
> St6vectorIdSaIdEE. Why?

That's a mangled name for 'std::vector<double>', which happened to be the
largest type in the 'my_types' list.

Aleksey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk