#include <iostream>
namespace meta
{
template < size_t > struct meta_size_t { } ;
}
namespace ns{
template < size_t N>
void bar( meta:: meta_size_t < N> ) ;
// overload??
void bar( meta:: meta_size_t < 1 > )
{
std:: cout << __PRETTY_FUNCTION__ << '\n ' ;
}
template < size_t N>
void bar( meta:: meta_size_t < N> )
{
std:: cout << __PRETTY_FUNCTION__ << '\n ' ;
bar( meta:: meta_size_t < N- 1 > ( ) ) ;
}
template < size_t N>
void foo( )
{
bar( meta:: meta_size_t < N> ( ) ) ;
}
}
int main( void )
{
ns:: foo < 5 > ( ) ;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKbmFtZXNwYWNlIG1ldGEKewogICAgdGVtcGxhdGU8c2l6ZV90PiBzdHJ1Y3QgbWV0YV9zaXplX3Qge307Cn0KCm5hbWVzcGFjZSBuc3sKICAgIAogICAgdGVtcGxhdGUgPHNpemVfdCBOPgogICAgdm9pZCBiYXIobWV0YTo6bWV0YV9zaXplX3Q8Tj4pOwoKICAgIC8vIG92ZXJsb2FkPz8KICAgIHZvaWQgYmFyKG1ldGE6Om1ldGFfc2l6ZV90PDE+KQogICAgewogICAgICAgIHN0ZDo6Y291dCA8PCBfX1BSRVRUWV9GVU5DVElPTl9fIDw8ICdcbic7CiAgICB9CgogICAgdGVtcGxhdGUgPHNpemVfdCBOPgogICAgdm9pZCBiYXIobWV0YTo6bWV0YV9zaXplX3Q8Tj4pCiAgICB7CiAgICAgICAgc3RkOjpjb3V0IDw8IF9fUFJFVFRZX0ZVTkNUSU9OX18gPDwgJ1xuJzsKICAgICAgICBiYXIobWV0YTo6bWV0YV9zaXplX3Q8Ti0xPigpKTsKICAgIH0KICAgIAogICAgdGVtcGxhdGU8c2l6ZV90IE4+CiAgICB2b2lkIGZvbygpCiAgICB7CiAgICAgICAgYmFyKG1ldGE6Om1ldGFfc2l6ZV90PE4+KCkpOwogICAgfQp9CgppbnQgbWFpbih2b2lkKQp7CiAgICBuczo6Zm9vPDU+KCk7CiAgICByZXR1cm4gMDsKfQ==