I see many C ++ examples using "foo ^ bar" - what is "^"?

Is this related to .NET? It seems to be some kind of pointer, what's the difference?

Edit:

I really know that this is an XOR operator, but look at this example from this page.

void objectCollection() {
    using namespace System::Collections;

    **ArrayList ^as = gcnew ArrayList;**

    //... }

What is it?

Thanks.

+5
source share
4 answers

I assume you are looking at form constructs:

Foo ^bar = gcnew Foo();

You are right, in .NET it is a pointer type of type "how to" and is part of C ++ / CLI, but not the standard C ++ ISO.

This is a reference to a garbage collected, managed .NET object, unlike a regular unmanaged C ++ object.

As another poster shows, outside the .NET world or in the context of creating an object, this is the XOR operator.

+14
source

++ XOR.

+5

I really know that this is an XOR operator, but look at this example from on this page .

void objectCollection()
{
    using namespace System::Collections;

    **ArrayList ^as = gcnew ArrayList;**

    //...
}

What is it?

0
source

This is a handle to the .NET reference type when using managed C ++. See this .

0
source

All Articles