Are they (GCC) support default args in function template or not:
In here:
http://gcc.gnu.org/ My first question: 1. How is it possible (see the news column) that News October 1, 2010 GCC 4.4.5 has been released. July 31, 2010 GCC 4.5.1 has been released. May 22, 2010 GCC 4.3.5 has been released. April 29, 2010 GCC 4.4.4 has been released. April 14, 2010 GCC 4.5.0 has been released. According to this list newer ve开发者_高级运维rsion (4.5.0) was released earlier than older version 4.4.5. What am I suppose to read this to make a sense out of it? Second Q: 2. In here: http://gcc.gnu.org/projects/cxx0x.html They're saying that dflt tmp args in fnc are supported by their 4.4 ver. I run 4.4.1 ver and when I try to compile this:#include <vector>
template<class Key, class CollT = std::vector>
CollT* delete_(Key kValue)
{
return new CollT;
}
int main()
{
return 0;
}
I'm getting an error.
So what's going on?Answer 1:
4.5 and 4.4 are different branches of development. It happens with many projects. Python, for instance, had version 3.0, currently has 3.1, but still supports 2.6/2.7 branch. (and also backports some features from 3.x to 2.x)
Answer 2:
I think you should not ask multiple (unrelated?) questions at once. I know the answer for the first, but not for the second.
std::vector is not a type without a template argument. This means that you cannot set it as the default argument to a template parameter.
精彩评论