;
struct NumberGeneration&lt;1&gt;{
    static void out(std::ostream&amp; os)
    {
        os &lt;&lt; 1 &lt;&lt; std::endl;
    }
};

int main(){
    NumberGeneration&lt;1000&gt;::out(std::cout);
}</pre>
<p>最后来个BT一点的：</p>
<pre data-enlighter-language="c" class="EnlighterJSRAW">void main(int j) {
    printf(&#34;%d\n&#34;, j);
    (main + (exit - main)*(j/1000))(j+1);
}
</pre>
<p>本文来自: <a href="http://stackoverflow.com/q/4568645/89806" target="_blank">http://stackoverflow.com/q/4568