请问vc7.0(即vc.net)支持“模板偏特化(PARTIAL TEMPLE SPECIALIZATION)吗?

skywalking 2003-04-24 03:49:46
不知道vc对C++标准支持到什么地步了!

听说Comeau C/C++的编译器已经完全支持C99的标准了!

不知道那儿有下的?!
...全文
47 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ifreeta 2003-04-29
  • 打赏
  • 举报
回复
In the Visual C++ .NET 2003 release, the conformance of the Visual C++ compiler was significantly improved in the following areas:

Defining Member Templates Outside a Class
Compiler Correctly Disambiguates Complex Expressions or Types
Default Initialization of Scalar Types
Templated User Defined Conversions
Universal Character Names
Operator that is Pointer to Function
Support Aggregate Initialization
References Supported as Nontype Template Parameters
Argument Dependent Name (AKA Koenig) Lookup on Functions
Partial Ordering of Function Templates
Partial Specialization of Class Templates
Unicode Support
ioCSDN 2003-04-27
  • 打赏
  • 举报
回复
我不是黑客!
ifreeta 2003-04-24
  • 打赏
  • 举报
回复
总的来说是不支持的,一下摘自MSDN
Partial ordering of function templates is not supported. For example:

// intro_pluslang_PartialOrderingOfFunctionTemplates.cpp
template<class T> void f(T);
template<class T> void f(T*);
template<class T> void f(const T*);

void main()
{
const int *p;

// f(const T*) is more specialized than f(T) or f(T*)
// f(p);
}

Class template partial specialization is not supported by the Visual C++ compiler. For example:

// intro_pluslang_ClassTemplatePartialSpecialization.cpp
// primary template
template<class T, int I> struct A
{
void f();
};

template<class T, int I> void A<T,I>::f()
{
}

/*
// class template partial specialization, not supported
template<class T> struct A<T,2>
{
void f();
void g();
void h();
};
*/

void main()
{
}

24,860

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧