Skip to main content
added 293 characters in body
Source Link
user1430
user1430

TArray is a template type in Unreal, which means you need to give it template parameters (within the angle brackets) when declaring one. In the case of TArray, you need at a minimum to indicate the type of data stored in the array. What you've written in your example is "a TArray of instances of type" and the compilererror is telling you that there is no type named type.

"Section IDs" sound like they'd be integers, so you should probably write TArray<int> to create an array of ints. Or whichever other integer type is appropriate.

(Other than TArray itself, which is an Unreal type, this is a general C++ problem regarding templates, so if you are looking for more background you don't need to look for Unreal-specific information... although the specific error you are seeing is an Unreal-specific one arising from how it parses your code and applies extra validation to UPROPERTY members, in this case putting additional constraints on the type parameter. TArray is roughly analogous in intent to the C++ standard library type std::vector.)


Reading through that tutorial link in more detail, much of the code samples seem to suffer from errors like this, including several declarations of TArray with no template parameters at all (which won't compile) as well as some stray characters at the end of some of the snippets.

TArray is a template type in Unreal, which means you need to give it template parameters (within the angle brackets) when declaring one. In the case of TArray, you need at a minimum to indicate the type of data stored in the array. What you've written in your example is "a TArray of instances of type" and the compiler is telling you that there is no type named type.

"Section IDs" sound like they'd be integers, so you should probably write TArray<int> to create an array of ints. Or whichever other integer type is appropriate.

(Other than TArray itself, which is an Unreal type, this is a general C++ problem regarding templates, so if you are looking for more background you don't need to look for Unreal-specific information... although the specific error you are seeing is an Unreal-specific one arising from how it parses your code and applies extra validation to UPROPERTY members, in this case putting additional constraints on the type parameter. TArray is roughly analogous in intent to the C++ standard library type std::vector.)

TArray is a template type in Unreal, which means you need to give it template parameters (within the angle brackets) when declaring one. In the case of TArray, you need at a minimum to indicate the type of data stored in the array. What you've written in your example is "a TArray of instances of type" and the error is telling you that there is no type named type.

"Section IDs" sound like they'd be integers, so you should probably write TArray<int> to create an array of ints. Or whichever other integer type is appropriate.

(Other than TArray itself, which is an Unreal type, this is a general C++ problem regarding templates, so if you are looking for more background you don't need to look for Unreal-specific information... although the specific error you are seeing is an Unreal-specific one arising from how it parses your code and applies extra validation to UPROPERTY members, in this case putting additional constraints on the type parameter. TArray is roughly analogous in intent to the C++ standard library type std::vector.)


Reading through that tutorial link in more detail, much of the code samples seem to suffer from errors like this, including several declarations of TArray with no template parameters at all (which won't compile) as well as some stray characters at the end of some of the snippets.

added 228 characters in body
Source Link
user1430
user1430

TArray is a template type in Unreal, which means you need to give it template parameters (within the angle brackets) when declaring one. In the case of TArray, you need at a minimum to indicate the type of data stored in the array. What you've written in your example is "a TArray of instances of type" and the compiler is telling you that there is no type named type.

"Section IDs" sound like they'd be integers, so you should probably write TArray<int> to create an array of ints. Or whichever other integer type is appropriate.

(Other than TArray itself, which is an Unreal type, this is a general C++ problem regarding templates, so if you are looking for more background you don't need to look for Unreal-specific information... although the specific error you are seeing is an Unreal-specific one arising from how it parses your code and applies extra validation to UPROPERTY members, in this case putting additional constraints on the type parameter. TArray is roughly analogous in intent to the C++ standard library type std::vector.)

TArray is a template type in Unreal, which means you need to give it template parameters (within the angle brackets) when declaring one. In the case of TArray, you need at a minimum to indicate the type of data stored in the array. What you've written in your example is "a TArray of instances of type" and the compiler is telling you that there is no type named type.

"Section IDs" sound like they'd be integers, so you should probably write TArray<int> to create an array of ints. Or whichever other integer type is appropriate.

(Other than TArray itself, which is an Unreal type, this is a general C++ problem regarding templates, so if you are looking for more background you don't need to look for Unreal-specific information. TArray is roughly analogous in intent to the C++ standard library type std::vector.)

TArray is a template type in Unreal, which means you need to give it template parameters (within the angle brackets) when declaring one. In the case of TArray, you need at a minimum to indicate the type of data stored in the array. What you've written in your example is "a TArray of instances of type" and the compiler is telling you that there is no type named type.

"Section IDs" sound like they'd be integers, so you should probably write TArray<int> to create an array of ints. Or whichever other integer type is appropriate.

(Other than TArray itself, which is an Unreal type, this is a general C++ problem regarding templates, so if you are looking for more background you don't need to look for Unreal-specific information... although the specific error you are seeing is an Unreal-specific one arising from how it parses your code and applies extra validation to UPROPERTY members, in this case putting additional constraints on the type parameter. TArray is roughly analogous in intent to the C++ standard library type std::vector.)

Source Link
user1430
user1430

TArray is a template type in Unreal, which means you need to give it template parameters (within the angle brackets) when declaring one. In the case of TArray, you need at a minimum to indicate the type of data stored in the array. What you've written in your example is "a TArray of instances of type" and the compiler is telling you that there is no type named type.

"Section IDs" sound like they'd be integers, so you should probably write TArray<int> to create an array of ints. Or whichever other integer type is appropriate.

(Other than TArray itself, which is an Unreal type, this is a general C++ problem regarding templates, so if you are looking for more background you don't need to look for Unreal-specific information. TArray is roughly analogous in intent to the C++ standard library type std::vector.)