Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Reply
 
Thread Tools Search this Thread Display Modes
Old 02-13-2008, 07:43 AM   #1
Kate12
Smurf
 
Kate12's Avatar
 
Join Date: Feb 2008
Posts: 6
Kate12 is on a distinguished road
Default Forward Declarations and Templates

It is illegal to use forward declarations with typedef names, as in:

class string;
void f(string& s); //illegal, string is a typedef name
Even a typename won't do here:

typename std::string; //still illegal
void f(std::string& s);
The problem with these forward declarations is that std::string is not a class, but a typedef name defined like this:

typedef basic_string<char, char_traits<char>, allocator<char> >string;
In order to generate the correct mangled name for the function f, the compiler has to see the non-typedef'd form of its argument. In other words, there is no escape from #including the header <string> in this case.
__________________
The cheerful looser is a winner
Kate12 is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 05-03-2008, 05:59 AM   #2
webvigor
Smurf
 
webvigor's Avatar
 
Join Date: Jun 2007
Posts: 24
webvigor is on a distinguished road
Default Re: Forward Declarations and Templates

There should be a tutorial section for that because that is a top not a problem.
webvigor is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Reply



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free PHPLD Template For v2.x Release (Fast Forward) cocomo Directories 0 11-07-2006 12:36 PM
pr4/5 pages look forward to exchange links burden924 Link Exchange 6 04-22-2006 10:17 AM
look forward to exchange link burden924 Wanted links 2 03-01-2006 07:39 AM
pr4/5 pages look forward to exchange links burden924 Links for Sale 1 02-28-2006 11:44 AM


All times are GMT. The time now is 09:51 PM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.