How to set the mesh as a master pose component for all of its sub mesh components?

I am actually trying to do this in a very short form such as in this blueprint image we set the base mesh once and attaching all its sub meshes to used the base mesh as a master pose component, we are not calling the base mesh for each of its sub mesh particularly.
image_2022-05-09_055623349

but in C++ I am calling the base mesh for each of the sub mesh each time.
Is it possible to call the base mesh once as in blueprint I did?

#pragma region Setting body parts
	//Setting fashion head mesh
	MeshHead = CreateDefaultSubobject <USkeletalMeshComponent>("HeadMesh");
	MeshHead->SetupAttachment(GetMesh());
	MeshHead->SetMasterPoseComponent(GetMesh());
	//Setting fashion hairs mesh
	MeshHairs = CreateDefaultSubobject <USkeletalMeshComponent>("HairsMesh");
	MeshHairs->SetupAttachment(GetMesh());
	MeshHairs->SetMasterPoseComponent(GetMesh());
	//Setting fashion chest mesh
	MeshChest = CreateDefaultSubobject <USkeletalMeshComponent>("ChestMesh");
	MeshChest->SetupAttachment(GetMesh());
	MeshChest->SetMasterPoseComponent(GetMesh());
	//Setting fashion vest mesh
	MeshVest = CreateDefaultSubobject <USkeletalMeshComponent>("VestMesh");
	MeshVest->SetupAttachment(GetMesh());
	MeshVest->SetMasterPoseComponent(GetMesh());
	//Setting fashion shoes mesh
	MeshShoes = CreateDefaultSubobject <USkeletalMeshComponent>("ShoesMesh");
	MeshShoes->SetupAttachment(GetMesh());
	MeshShoes->SetMasterPoseComponent(GetMesh());
	//Setting fashion whole mesh
	MeshWhole = CreateDefaultSubobject <USkeletalMeshComponent>("WholeMesh");
	MeshWhole->SetupAttachment(GetMesh());
	MeshWhole->SetMasterPoseComponent(GetMesh());
	//Setting fashion hands mesh
	MeshHands = CreateDefaultSubobject <USkeletalMeshComponent>("HandsMesh");
	MeshHands->SetupAttachment(GetMesh());
	MeshHands->SetMasterPoseComponent(GetMesh());
	//Setting fashion backpack mesh
	MeshBackpack = CreateDefaultSubobject <USkeletalMeshComponent>("BackpackMesh");
	MeshBackpack->SetupAttachment(GetMesh());
	MeshBackpack->SetMasterPoseComponent(GetMesh());
	//Setting fashion body mesh
	MeshBody = CreateDefaultSubobject <USkeletalMeshComponent>("BodyMesh");
	MeshBody->SetupAttachment(GetMesh());
	MeshBody->SetMasterPoseComponent(GetMesh());
#pragma endregion End Setting body parts