GIDForums  

Go Back   GIDForums > Computer Programming Forums > CPP / C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Dec-2004, 16:49
LaVache LaVache is offline
New Member
 
Join Date: Aug 2004
Posts: 4
LaVache is on a distinguished road
Talking

templates are not supported?


Hi all,

I was building a dll using MFC on .Net 7.1 and have these this template:
CPP / C++ / C Code:

  template <class T>
  T min(const T& a ,const T& b)
  {
    return (a < b)? a : b;
  }

  template <class T>
  T max(const T& a ,const T& b)
  {
    return (a > b)? a : b;
  }


and got error saying the type T is not regognized:
Code:
a.h(58) : error C2059: syntax error : 'function-style cast' a.h(58) : error C2226: syntax error : unexpected type 'T' a.h(58) : error C2059: syntax error : ')' a.h(64) : error C2062: type 'const int' unexpected a.h(64) : error C2059: syntax error : ')' a.h(65) : error C2143: syntax error : missing ';' before '{' a.h(65) : error C2447: '{' : missing function header (old-style formal list?)

I remember someone told me that templates were not supported somewhere but I don't remember exactly what it is... is it .Net or MFC???

Here is what I found on the tutorial www.cplusplus.com :

Quote:

Templates are a new feature introduced by ANSI-C++ standard. If you use a C++ compiler that is not adapted to this standard it is possible that you cannot use them.


Could someone tell me where and why these templates are not supported?

Thank you!

LaVache
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem understanding how to use templates monospaz MS Visual C++ / MFC Forum 5 08-Jun-2008 12:47
How to choose a good Web Design Company? everest Web Design Forum 4 04-Aug-2004 23:27

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:45.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.