Closed rpatters1 closed 2 years ago
for_each
iterates all reflected members, is_property
selectes functions with property()
specified, is_writable
selects those properties which have an overload that looks like a setter (non-const function with 1 parameter; see def).
GetDateFormat
expands to either GetDateFormatA
or GetDateFormatW
, depending on the UNICODE
macro. I believe what you've effectively declared in your code is a member int GetDateFormatW() const
, which you have then reflected with REFL_FIELD
. get_reader
attempts to find a matching getter for SetDateFormat
called GetDateFormat
, but there is only GetDateFormatW
, so it fails.
You say you have tried #undef GetDateFormat
and it makes no difference? Can you post the error messages for both of these, or even better, a Compiler Explorer link?
I must have been too sleep-deprived last night. #undef
is actually working this morning.
I've got a class with the following:
The issue is that
GetDateFormat
is a macro defined by the Window API. It messes upget_reader
. Oddly, it doesn't mess up thefor_each
loop. If I change the code so that it doesn't callget_reader
it compiles, and I can successfully process the getter (though not correctly for my requirements).I have tried
#undef GetDateFormat
, but that makes no difference. I tried(GetDateFormat)
, which normally is how you prevent macro expansion, but that doesn't work inside a macro. I would try to make a change toget_reader
but I don't understand the code well enough. I could brute force my way out of this by changing the name, but that has downline consequences beyond my control.If you have any suggestions, I would appreciate them.