[重复]VS2022的展开内联功能

2023/10 18 23:10

把鼠标放置在宏上面, 自动弹出的菜单中有显示展开内联. 可以将宏全部展开, 非常不错的功能

示例:

class ALyraGameMode : public AModularGameModeBase
{
    GENERATED_BODY()

展开内联后,则为:

class ALyraGameMode : public AModularGameModeBase
{
  __pragma (warning(push))
  __pragma (warning(disable: 4995)) 
  __pragma (warning(disable: 4996))

public:    

  static void execOnUserInitializedForDedicatedServer(UObject* Context, FFrame& Stack, void* const Z_Param__Result); 
  static void execRequestPlayerRestartNextFrame(UObject* Context, FFrame& Stack, void* const Z_Param__Result); 
  static void execGetPawnDataForController(UObject* Context, FFrame& Stack, void* const Z_Param__Result);  

private: 
  static void StaticRegisterNativesALyraGameMode(); 
  friend struct Z_Construct_UClass_ALyraGameMode_Statics; 

private: 
  ALyraGameMode& operator=(ALyraGameMode&&); 
  ALyraGameMode& operator=(const ALyraGameMode&);  
  static UClass* GetPrivateStaticClass();

public: 
  static constexpr EClassFlags StaticClassFlags 
    = EClassFlags((0 | CLASS_Transient | CLASS_Config | CLASS_Intrinsic));

  typedef AModularGameModeBase Super; 
  typedef ALyraGameMode ThisClass;

  inline static UClass* StaticClass() 
  {
    return GetPrivateStaticClass();
  }

  inline static const TCHAR* StaticPackage() 
  {
    return L"/Script/LyraGame";
  }

  inline static EClassCastFlags StaticClassCastFlags() 
  {
    return CASTCLASS_None;
  }

  inline void* operator new(const size_t InSize, EInternal InInternalOnly, 
    UObject* InOuter = (UObject*)GetTransientPackage(), 
    FName InName = NAME_None, EObjectFlags InSetFlags = RF_NoFlags) 
  {
    return StaticAllocateObject(StaticClass(), InOuter, InName, InSetFlags);
  }

  inline void* operator new(const size_t InSize, EInternal* InMem) 
  {
    return (void*)InMem;
  }

  inline void operator delete(void* InMem) 
  {
    ::operator delete(InMem);
  }

  friend FArchive& operator<<(FArchive& Ar, ALyraGameMode*& Res) 
  {
    return Ar << (UObject*&)Res;
  }

  friend void operator<<(FStructuredArchive::FSlot InSlot, ALyraGameMode*& Res) 
  {
    InSlot << (UObject*&)Res;
  }

private:  
  ALyraGameMode(ALyraGameMode&&);  
  ALyraGameMode(const ALyraGameMode&); 

public:  
  ALyraGameMode(FVTableHelper& Helper);

  static UObject* __VTableCtorCaller(FVTableHelper& Helper) 
  {
    return new (EC_InternalUseOnlyConstructor, (UObject*)GetTransientPackage(),
      NAME_None, RF_NeedLoad | RF_ClassDefaultObject | RF_TagGarbageTemp) ALyraGameMode(Helper);
  };

  static void __DefaultConstructor(const FObjectInitializer& X) 
  {
    new((EInternal*)X.GetObj())ALyraGameMode(X);
  }

  virtual ~ALyraGameMode(); 
private: 
  __pragma (warning(pop));
// 这样在写代码时,就可以方便地写:

GetWorld()->GetTimerManager().SetTimerForNextTick(this, &ThisClass::HandleMatchAssignmentIfNotExpectingOne);

void ALyraGameMode::InitGameState()
{
    Super::InitGameState();
}

//----而不必写----

GetWorld()->GetTimerManager().SetTimerForNextTick(this, &ALyraGameMode::HandleMatchAssignmentIfNotExpectingOne);

void ALyraGameMode::InitGameState()
{
    AModularGameModeBase::InitGameState();
}