为什么在C ++ 11中没有`static_if' [英] Why there is no `static_if` in C++11
问题描述
我不知道为什么像 static_if
这样的自然东西不能进入C ++ 11?有些人反对使用继承或模板专门化我们可以实现要求的结果:
I wonder why such a natural thing like static_if
did not manage to get into C++11? Some people object that using inheritance or template specialization we could achieve demanded results BUT:
为什么我们没有一个简单的 static_if
Why don't we have a simple static_if
for simple situations when one doesn't want to bloat up the source code with all that?
推荐答案
对于简单的情况,当我不想使所有的源代码膨胀时commitee没有时间讨论这个功能,所以他们决定延迟它在C ++ 11后。无论如何,建议都在这里: http://www.open-std.org /jtc1/sc22/wg21/docs/papers/2012/n3329.pdf
I suppose the commitee was short of time to discuss this feature so they decide to delay it after C++11. Anyway proposal is here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3329.pdf
这篇关于为什么在C ++ 11中没有`static_if'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!