Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
3.00/5 (4 votes)
See more:
I can't find a reference explaining the caret/"hat"/"^" symbol. Could someone please give me a link?

ERandall
Posted
Updated 3-Jun-12 5:53am
v3
Comments
Sergey Alexandrovich Kryukov 3-Jun-12 23:37pm    
The problem is simple: this is not C++, this is C++/CLI, too bad you don't realize it.
--SA
Maximilien 5-Jun-12 11:53am    
Is it? I've seen it in the recent native C++ Metro/Win8 code for C++/CX which is native C++ (not managed) and supported by Herb Sutter (who is a native C++ guru).

It means it is a reference to a managed object, as opposed to a pointer to unmanaged memory.

Have a look at MSDN: http://msdn.microsoft.com/en-US/library/yk97tc08(v=vs.80)[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 3-Jun-12 23:43pm    
The problem with this link is: it's about the language "managed C++" which was superseded by "C++/CLI".
The "managed C++" is something which is hardly worth learning these days...
--SA
Prasad_Kulkarni 4-Jun-12 2:28am    
5'ed!
By calling this thing a "hat" you look like a person who sees the integral symbols in mathematical text and calls them "hooks". Trying to guess about them is not so productive, pretty much like now knowing which computer language you are looking at. I must admit that the party responsible for certain mess in terminology is Microsoft.

Please see my comment to the question. You just need to learn this language, which is not exactly the C++.
References? Sure:

http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.gotw.ca/publications/C++CLIRationale.pdf[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^],
http://msdn.microsoft.com/en-us/library/3bstk3k5%28v=vs.100%29[^].

[EDIT]
Please also see my comment to the answer by OriginalGriff.

[EDIT]
The character '^' denotes a managed pointer, or a reference sign. C++/CLI has some unique feature not available in other .NET languages: referenced are treated as explicit managed pointers. In other languages, all reference type are accessed and manipulated only via their references, which does not create problems. With C++/CLI, a reference-type object can be manipulated via the reference denoted by '^', or though the non-reference variable, without '^'. That said, C++/CLI allows using of value semantic for reference objectс. Refer to the books/articles referenced above.

—SA
 
Share this answer
 
v6
Comments
Prasad_Kulkarni 4-Jun-12 2:28am    
Good links +5!
Sergey Alexandrovich Kryukov 4-Jun-12 3:14am    
Thank you, Prasad.
--SA
Emilio Garavaglia 4-Jun-12 9:33am    
^ in mathematical formulas is commonly called (and read as) "hat" (italian: "cappello") at least in Italy. I never heard as "hook" for integral as well. I suspect it's not a matter of technical culture, but of its localization.

BTW: # is usually called "gate" and @ "snail"
Albert Holguin 4-Jun-12 13:55pm    
OP posted as solution 3:
Thanks, SA

I called it a "hat" because Herb Sutter did so on one the Channel 9 videos that caused me to ask the question.

Knowing that it is CLI-related explains a lot. (btw: I never thought of the integral symbol as a 'hook', it was always the 'integral' to me...but now that you mention it...)

ERandall
Sergey Alexandrovich Kryukov 5-Jun-12 11:13am    
Thank you, Albert; thank you, ERandal,
How you name a character is not a point, I just mentioned this as a curious thing; sorry if you dislike it.
Anyway, if you agree my answer is an answer, please accept it formally (green button) -- thanks.
I'll add few words about C++/CLI which might be relevant and important enough, after [EDIT].
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900