Boost logo

Boost :

From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2007-12-04 13:01:33


Mathias Gaunard wrote:

> One can maybe extract some entropy from macros such as __DATE__ and
> __TIME__, using both preprocessing and templates.

I had another crazy idea: exploit the fact that date and time are
separate to map the rather limited (compared to full time) range of
possibilities.

template<const char*>
struct date
{
};

template<> struct<"Dec 4 2007">
{
     static const int month = 12;
     static const int day = 4;
     static const int year = 2007;
};

then use struct<__DATE__>.

However it seems C++ doesn't allow this either?


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