Compiler thinks there is No binary conversion for uint32, making << operator for FConstraintInstance

error C2679: binary ‘<<’ : no operator found which takes a right-hand operand of type ‘uint32’ (or there is no acceptable conversion)

#Edit

I see in ArchiveBase, 196

/**
	 * Serializes an unsigned 32-bit integer value from or into an archive.
	 *
	 * @param Ar - The archive to serialize from or to.
	 * @param Value - The value to serialize.
	 */
	FORCEINLINE friend FArchive& operator<<(FArchive& Ar, uint32& Value)
	{
		Ar.ByteOrderSerialize(&Value, sizeof(Value));

		return Ar;
	}

but compiler is not recognizing this for some reason!

it lists the correct conversion in the long list of the << operator possibilities, but is still saying it cant find the uint32 conversion when I am trying to do the following:

//Constraint Instance
FORCEINLINE FArchive &operator <<(FArchive &Ar, FConstraintInstance& TheStruct )
{
	//Collision
	Ar << TheStruct.bDisableCollision;
	
	//Projection
	Ar << TheStruct.bEnableProjection;
	Ar << TheStruct.ProjectionLinearTolerance;
	Ar << TheStruct.ProjectionAngularTolerance;
	
	//Linear Limit
	Ar << TheStruct.LinearXMotion;
	Ar << TheStruct.LinearYMotion;
	Ar << TheStruct.LinearZMotion;
	Ar << TheStruct.LinearLimitSize;
	Ar << TheStruct.bLinearLimitSoft;
	Ar << TheStruct.LinearLimitStiffness;
	Ar << TheStruct.LinearLimitDamping;
	Ar << TheStruct.bLinearBreakable;
	Ar << TheStruct.LinearBreakThreshold;
	Ar << TheStruct.LinearYMotion;
	
	//Angular Limit
	Ar << TheStruct.AngularSwing1Motion;
	Ar << TheStruct.AngularSwing2Motion;
	Ar << TheStruct.AngularTwistMotion;
	Ar << TheStruct.bSwingLimitSoft;
	Ar << TheStruct.bTwistLimitSoft;
	Ar << TheStruct.Swing1LimitAngle;
	Ar << TheStruct.Swing2LimitAngle;
	Ar << TheStruct.TwistLimitAngle;
	Ar << TheStruct.SwingLimitStiffness;
	Ar << TheStruct.TwistLimitStiffness;
	Ar << TheStruct.SwingLimitDamping;
	Ar << TheStruct.TwistLimitDamping;
	Ar << TheStruct.bAngularBreakable;
	Ar << TheStruct.AngularBreakThreshold;
	
	//Linear Drive
	Ar << TheStruct.bLinearXPositionDrive;
	Ar << TheStruct.bLinearYPositionDrive
	Ar << TheStruct.bLinearZPositionDrive;
	Ar << TheStruct.bLinearPositionDrive;
	Ar << TheStruct.bLinearVelocityDrive;
	Ar << TheStruct.LinearPositionTarget;
	Ar << TheStruct.LinearVelocityTarget;
	Ar << TheStruct.LinearDriveSpring;
	Ar << TheStruct.LinearDriveDamping;
	Ar << TheStruct.LinearDriveForceLimit;
	
	//Angular Drive
	Ar << TheStruct.bAngularOrientationDrive;
	Ar << TheStruct.bAngularVelocityDrive;
	Ar << TheStruct.AngularOrientationTarget;
	Ar << TheStruct.AngularVelocityTarget;
	Ar << TheStruct.AngularDriveSpring;
	Ar << TheStruct.AngularDriveDamping;
	Ar << TheStruct.AngularDriveForceLimit;
	
}

Rama

I know this is super old, but I’m running into the same problem now. Did you ever resolve this issue?

Scratch that, figured it out. Two problems:

  • I had my uint32 on the left side of the <<. The archive must ALWAYS be on the left.
  • I was using a pointer to the archive, so I needed to dereference it to use the << operator.

Hi,

I’m having the same problem.

void USpiderMovementComponent::SaveLoad(FArchive& Ar) {
	Ar << bAlwaysCheckFloor;
....

Did you solve this?

Rama, I’m basically following your tutorial.

Regards,

B