Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

Some problems about using template class in Visual C++ 6.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BinaryBoy - 01 Jun 2004 10:21 GMT
1. If the declaration and definition of a member function of a template class is separated
then while using the auto_complete,the function's information will not be shown.

2. If a member function of a template class is not called by other normal function
then some of it's syntax error can't be find while compiling, maybe this function even haven't be compiled

How could I solve these problems? thank you.
Carl Daniel [VC++ MVP] - 01 Jun 2004 14:23 GMT
> 1. If the declaration and definition of a member function of a
> template class is separated,
> then while using the auto_complete,the function's information will
> not be shown.

Intellisense and auto-complete in VC6 has many problems with advanced
features like templates.  There's normally nothing you can do.

> 2. If a member function of a template class is not called by other
> normal function,
> then some of it's syntax error can't be find while compiling, maybe
> this function even haven't be compiled.

This is a limitation of how VC++ compiles C++ code, and to some extent, a
limitation of C++ itself.  Template definitions are only barely parsed by
VC++ when they're encountered and aren't subject to a complete syntax check
until they're instantiated.  In general, it's not possible for a C++
compiler to determine if a template is valid until it's instantiated (since
the validity of the template depends on the type(s) used in the
instantiation), but VC++ could catch more errors than it does.

The solution to this is to properly test your software - write a test suite
for your template that exercises every member and feature.  You do that for
all your code, right?

-cd
BinaryBoy - 02 Jun 2004 03:36 GMT
Thank you for your explanation an advise
I have found a way to solve problem 1
write the declaration and defination together in the class declaration,like the STL
   
    ----- Carl Daniel [VC++ MVP] wrote: ----
   
    BinaryBoy wrote
    > 1. If the declaration and definition of a member function of
    > template class is separated
    > then while using the auto_complete,the function's information wil
    > not be shown
   
    Intellisense and auto-complete in VC6 has many problems with advance
    features like templates.  There's normally nothing you can do

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.