Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2003-01-06 07:31:09


Terje Slettebø wrote:

> The results don't necessarily have to be printed out at
> compile-time (Erwin Unruh printed the results using compiler-warnings, but
> that is of course highly implementation dependent).

> "Hello, world" in compile-time programming doesn't necessarily have to be
> the same kind of program as in run-time programming, since the way it works
> is different.

I suspect a metaprogram that does nothing but issue a few diagnostics
would be dismissed as a curiosity, maybe a cool toy, but hardy seen as
an interesting tool by someone new to the idea.

Creating a static array of size 5! shows a little more potential, but
what to do with the array?

However, it is far too easy to be negative when I have nothing better to
offer in return (although I will be quite keen to see the final example,
MPL is one of those items on my 'to-do' list that never quite hits the
top)

What are people actively doing with MPL anyway? Perhaps and answer to
that question will indicate what 'Hello world' should look like. It
should be more than a neat exercise in syntax, it should demonstrate the
idea of real-world use.

Currently I mainly use compile-time techniques for static assertions.

I have written some toy curiousities such as the classic factorial
generator and recursive array-like containers. I am yet to make the
leap from playing with the syntax to applying it to real world problems,
and if we can come up with a simple example that makes that leap, we'll
have hit gold [where 'we' here clearly means 'you' <g>]

-- 
AlisdairM

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