x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Passing generic Structure Object to C++ Function

Hi,

I'm trying to implement a function in C++ to which I can pass an object of any structure as a parameter.

Unfortunately this fails because of the type of the passing parameter.

Here is an example of what I would like to accomplish with an user defined structure:

alt text

alt text

It seems like the type needs to be FStructOnScope, so, my function would need to look like

 static FString DoSomethingWithStructInstance(const FStructOnScope* StructData);

But FStructOnScope isn't supported, is that the wrong type or is there a way to accomplish what I want?

Thank you in advance

Product Version: UE 4.21
Tags:
dosomehting.png (42.1 kB)
poststructure.png (15.4 kB)
more ▼

asked Mar 21 '19 at 10:36 AM in C++ Programming

avatar image

RelaX92
5 1 1 3

avatar image Nebula Games Inc Mar 21 '19 at 03:15 PM

Would be interesting to know how to do this. I have tried to figure this out but never did. The best advice I got was looking into the "wildcard" slots for things like the "For Each Loop" macros and other nodes that take in wildcard data and see how UE4 source handles it.

avatar image RelaX92 Mar 21 '19 at 05:27 PM
avatar image Nebula Games Inc Mar 21 '19 at 05:30 PM

Haha, glad I could point you in the right direction :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
more ▼

answered Mar 21 '19 at 05:25 PM

avatar image

RelaX92
5 1 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question