Hi, Is there any way to check step by step what's going on in let's say template? I mean how it is instantiated step by step and so on?
In book I've mentioned here ,
I found (2 minutes ago) quite interesting example of how binary could be implemented as a metafunction.
template <unsigned long N>
struct binary
{
static unsigned const value
= binary<N/10>::value << 1 // prepend higher bits
| N%10; // to lowest bit
};
template <> // specialization
struct binary<0> // terminates recursion
{
static unsigned const value = 0;
};
and I think it could be quite useful to be able to see step by step what's been done during the instantiation of this template. Thanks for your replies.