Json2: How to "dereference" T
after $if T is $pointer
?
#25375
Unanswered
jorgeluismireles
asked this question in
Questions and Answers
Replies: 2 comments 3 replies
-
In theory one could use * to dereference a pointer. But that is not possible here since the type T has to be dereferenced. |
Beta Was this translation helpful? Give feedback.
3 replies
-
This should be a feature suggestion. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to make json2 encode (and later decode) struct references to produce texts like
[{},null,{}]
. Next program so far differentiates among[]&Struct
and[]Struct]
.Results:
My idea is to add in
json2.encode_value
as a pre-check this section:Above code works produces the correct elements of array
[{"a":1},null,{"a":3}]
except has hardwired the typeStruct
:Is there a way in this line of code "dereference" T which is
&Struct
intoStruct
in orderjson2
parse it? Actuallyjson2.encode
returns silently empty string for references, thats why return things like[,,]
. Passing the "dereference" should work as far as I understand.Beta Was this translation helpful? Give feedback.
All reactions