User talk:132.199.97.100: Difference between revisions

From Rosetta Code
Content added Content deleted
(C++/CLI)
 
(^ in C++/CLI is used to declare CLI object pointers; ^ still doubles as bitwise xor (not bitwise not))
Line 1: Line 1:
Hey there. My biggest confusion regarding the C++/CLI example was the syntax I saw using the ^ operator. It looked like bitwise-not was being applied in an syntactically-incorrect fashion. I take it ^ isn't bitwise-not in C++/CLI? --[[User:Short Circuit|Michael Mol]] 13:26, 6 August 2010 (UTC)
Hey there. My biggest confusion regarding the C++/CLI example was the syntax I saw using the ^ operator. It looked like bitwise-not was being applied in an syntactically-incorrect fashion. I take it ^ isn't bitwise-not in C++/CLI? --[[User:Short Circuit|Michael Mol]] 13:26, 6 August 2010 (UTC)

: The ^ operator was never used for bitwise not in C or C++ (the bitwise not operator is ~). The binary ^ is xor, and remains to have that function in C++/CLI. However in C++/CLI, ^ can also be used in declarations to define a CLI object pointer (i.e. a pointer to a "managed" object). This is quite similar to the double use of * to mean both multiplication (2*5) and declaration of pointer (int* p), except that * can in addition be used as unary dereference operator (*p), which I don't think is possible with ^. --[[Special:Contributions/132.199.97.100|132.199.97.100]] 14:07, 6 August 2010 (UTC)

Revision as of 14:07, 6 August 2010

Hey there. My biggest confusion regarding the C++/CLI example was the syntax I saw using the ^ operator. It looked like bitwise-not was being applied in an syntactically-incorrect fashion. I take it ^ isn't bitwise-not in C++/CLI? --Michael Mol 13:26, 6 August 2010 (UTC)

The ^ operator was never used for bitwise not in C or C++ (the bitwise not operator is ~). The binary ^ is xor, and remains to have that function in C++/CLI. However in C++/CLI, ^ can also be used in declarations to define a CLI object pointer (i.e. a pointer to a "managed" object). This is quite similar to the double use of * to mean both multiplication (2*5) and declaration of pointer (int* p), except that * can in addition be used as unary dereference operator (*p), which I don't think is possible with ^. --132.199.97.100 14:07, 6 August 2010 (UTC)