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++ / February 2008

Tip: Looking for answers? Try searching our database.

typedef

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George3 - 19 Feb 2008 07:27 GMT
Hello everyone,

In the following segment, it does not compile because const is
qualified on (the whole) type int& not on the near one int, right?

Code:
--------------------
 
 #include <iostream>
 
 using namespace std;
 
 typedef const int& rcInt;
 typedef int& int_ref_t;
 
 int main()
 {
     rcInt ref = 0; // compile ok
 
     const int_ref_t x = 0; // error C2440: 'initializing' : cannot convert from 'int' to 'int_ref_t'
 
     return 0;
 }
 
--------------------

thanks in advance,
George
Tamas Demjen - 19 Feb 2008 18:21 GMT
>   #include <iostream>
>  
[quoted text clipped - 11 lines]
>       return 0;
>   }

The type of `ref' is: int const &
The type of `x' is: int & const

This should point you to the right direction.

Tom
Tamas Demjen - 19 Feb 2008 18:48 GMT
George,

You posted this question to microsoft.public.vc.language, and it was
already answered there. Do you realize that you are wasting people's time.

Pick a group where your question belongs to. If you must post it to
multiple groups, please crosspost. Had you crossposted this question,
the previous answers would have showed up here.

Multiposting causes the discussion to split between multiple groups.
Only crossposting ensures that the full discussion gets combined.

Tom
David Wilkinson - 19 Feb 2008 20:39 GMT
> George,
>
[quoted text clipped - 7 lines]
> Multiposting causes the discussion to split between multiple groups.
> Only crossposting ensures that the full discussion gets combined.

Tamas:

If you wish to change George's behavior (a good idea, IMHO), you need to post in
microsoft.public.vc.language, because he only ever answers there.

However I have become convinced that George is not s simple multi-poster. Either
he is deliberately trying to disrupt these groups, or (as he claims) his posts
are being copied to this group without his knowledge. Recent duplicated posts in
this group are all "Posted via http://www.codecomments.com", whereas the
"original" posts in microsoft.public.vc.language are not.

Signature

David Wilkinson
Visual C++ MVP


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.