PSS ID Number: 190966
Article Last Modified on 10/15/2002
//Test.cpp
#include <stdio.h>
// A Template Class
//
template <class T, int i>
class TempClass
{
public:
TempClass(void){}
~TempClass(void){}
int MemberSet(T a, int b);
int GetSize()
{
return arraysize;
}
private:
T Tarray[i];
int arraysize;
};
// A Simple Class
//
class TestClass
{
public:
TestClass(void){}
~TestClass(void){}
int m;
int n;
};
// Template Member Function Defined outside of the template class
//
template <class T, int i>
int TempClass<T, i>::MemberSet(T a, int b)
{
if( ( b >= 0 ) && (b < i) )
{
Tarray[b++] = a;
return sizeof( a );
}
else
return -1;
};
// Template Class
//
template <class T>
class Print
{
public:
// Declare an instance of TestClass
TestClass te;
// EXAMPLE
//te.
// #2 No members displayed
// all types but char
void f(int, double)
{
printf("Print<T>\n");
}
};
// Specialization of Print<class T>
//
template <>
class Print<char>
{
public:
// just for chars
void f(char*)
{
printf("Print<char>\n");
}
};
void main()
{
TempClass<char,10> t;
// EXAMPLE
//t.
// #1 MemberSet is absent from the member list
// MemberSet does not appear in the ClassView pane
// Define MemberSet in the TempClass declaration
// to correct this problem
Print<char> pc;
// EXAMPLE
//pc.f(
// #3
// pc.f Tool tip shows all types but char
// pc.f( Parameter list is int, double
}153284 Limitations of IntelliSense in Visual C++ 6.0
Additional query words: kbvc600bug
Keywords: kbBug KB190966
Technology: kbAudDeveloper kbVC32bitSearch kbVC600 kbVCNET kbVCsearch