HI,
I have a AttackNode class that looks like this
class ABHIMANYU_API AttackNode
{
public:
/** Constructor
*/
AttackNode(FName AttackTag, UAnimMontage* Montage);
AttackNode(AttackNode& Other);
AttackNode(AttackNode&& Other);
}
And when I try to create a shared pointer like this
TSharedPtr<AttackNode> primary_attack_lvl_1 = MakeShared<AttackNode>("Primary_1_1", primary_1_montage);
I get error saying
Error C2664 ‘AttackNode::AttackNode(AttackNode &&)’: cannot convert argument 1 from ‘const char [1]’ to ‘const AttackNode &’
But if I remove the UAnimMontage* from constructor and have just FName as single parameter it works.
I added copy and move constructors thinking that maybe I need to explicitly create them for TSharedPtr with multiple parameters to work but I still get this error.
As far as I can remember std::shared_ptr never had problems with classes that needs multiple parameters during construction.
Can someone explain what is wrong I’m doing here and what the error is about?