Some questions about special operators that I have never seen in C ++ code

I downloaded the Phoenix SDK June 2008 (Tools for Compilers), and when I read the Hello example code, I really feel lost.

public
ref class Hello
{
//--------------------------------------------------------------------------
//
// Description:
//
//    Class Variables.
//
// Remarks:
//
//    A normal compiler would have more flexible means for holding
//    on to all this information, but in our case it simplest (if
//    somewhat inelegant) if we just keep references to all the
//    structures we'll need to access as classstatic variables.
//
//--------------------------------------------------------------------------

static Phx::ModuleUnit                 ^ module;
static Phx::Targets::Runtimes::Runtime ^ runtime;
static Phx::Targets::Architectures::Architecture       ^ architecture;
static Phx::Lifetime                   ^ lifetime;
static Phx::Types::Table               ^ typeTable;
static Phx::Symbols::Table                ^ symbolTable;
static Phx::Phases::PhaseConfiguration        ^ phaseConfiguration;

2 Questions: What is the ref keyword? What is this sign? What is he doing

protected:

  virtual void
  Execute
  (
     Phx::Unit ^ unit
  ) override;

};

is override also a C ++ keyword? It is painted as such in my Visual Studio. I really want to play with this infrastructure, but this advanced C ++ really is an obstacle right now. Thanks.

+3
source share
4 answers

This is not standard C ++, it is C ++ / CLI .

+12
source

Microsoft .NET. , . . .

+5

++/CLI, .Net, ++.

  • ref - ,
  • ^ -
  • override -
+5

++. ++/CLI, Microsoft, ++:

++/CLI ( ) - Microsoft , supersede Managed Extensions ++. , ++ ( ), , ++. ++/CLI Ecma ECMA-372. Visual Studio 2005 2008 ( Editions).

- ++/CLI , Rob Walker, :

... of * (), ++/CLI "" " " ( ). Microsoft.

The use of "ref class X" instead of the familiar "class X" is discussed in this post.

+4
source

Source: https://habr.com/ru/post/1709348/


All Articles