Hi,
I was wondering if the following 2 approaches produce identical output?
Personally I prefer the one with default initialization, but I'm not 100% sure if that ‘combines’ with the specified ctor. So basically, will the variables that are not in the initializer list, still get the the default value from the variable declarations in the struct?
struct TUPLE_CAMERA
{
int CameraIndex = -1;
int TransformIndex = -1;
int RenderBucketIndex = -1;
int SkyboxMeshRendererIndex = -1;
TUPLE_CAMERA() { }
TUPLE_CAMERA(const int pCameraIndex, const int pTransformIndex) : CameraIndex(pCameraIndex), TransformIndex(pTransformIndex) { }
};
Versus
struct TUPLE_CAMERA
{
int CameraIndex;
int TransformIndex;
int RenderBucketIndex;
int SkyboxMeshRendererIndex;
TUPLE_CAMERA() : CameraIndex(-1), TransformIndex(-1), RenderBucketIndex(-1), SkyboxMeshRendererIndex(-1) { }
TUPLE_CAMERA(const int pCameraIndex, const int pTransformIndex) : CameraIndex(pCameraIndex), TransformIndex(pTransformIndex), RenderBucketIndex(-1), SkyboxMeshRendererIndex(-1) { }
};