Skip to content
Snippets Groups Projects
Select Git revision
  • Sprint/2021-05
  • master default protected
  • dev protected
  • Issue/3003-stsInstitute
  • gitkeep
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2309-docs
  • Fix/xxxx-updateDependencies
  • Issue/2364-testingKpiParser
  • Issue/2287-guestRole
  • Test/xxxx-pipelineTriggers
  • Issue/2102-gitLabResTypeRCV
  • Issue/2278-gitlabToS
  • Issue/2101-gitLabResTypeUi
  • Issue/1788-extractionCronjob
  • Issue/2183-kpiGeneratorResource
  • Issue/2222-resourceDateCreated
  • Issue/2221-projectDateCreated
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1999-gitlabResourcesLib
  • Issue/1951-quotaImplementation
  • v2.22.0
  • v2.20.0
  • v2.19.1
  • v2.19.0
  • v2.18.0
  • v2.17.0
  • v2.16.2
  • v2.16.1
  • v2.16.0
  • v2.15.0
  • v2.14.0
  • v2.13.0
  • v2.12.1
  • v2.12.0
  • v2.11.1
  • v2.11.0
  • v2.10.1
  • v2.10.0
  • v2.9.1
  • v2.9.0
41 results

Program.cs

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    s2_e3.1_rawPtr.cxx 800 B
    // SPDX-FileCopyrightText: © 2022 Competence Center for High Performance Computing in Hessen (HKHLR) <christian.iwainksy@hpc-hessen.de>
    //
    // SPDX-License-Identifier: MIT
    
    #include <memory>
    #include <iostream>
    using namespace std;
    struct Example {
      int myInt;
      Example(int arg):myInt(arg){};
      virtual ~Example(){cout<<"~Example" << myInt<<endl;};
    };
    struct Adapter {
      Example * TheExample;
      Adapter(Example * arg):TheExample(arg){};
      Example * get(){return TheExample;}
    };
    
    int main(int argc,char**){
      Example * rawPtr = new Example(11);
      cout << "rawPtr = " << rawPtr<< endl;
      Adapter adapter=Adapter(rawPtr);
      cout << "rawPtr = " << rawPtr<< endl;
      cout << "Use of example:" << adapter.get()->myInt << endl;
      adapter=Adapter(nullptr);
      cout << "End of Program" << endl;
      return 0;
    }