[External] Re: [xsd-users] Template for member created by Code Synthesis

Boris Kolpackov boris at codesynthesis.com
Fri Feb 27 06:36:18 EST 2015


Hi Hillel,

Markowitz, Hillel [USA] <Markowitz_Hillel at bah.com> writes:

> Thank you. looking at this, I see that it explicitly has memberA_pushback.
> I have been able to create templates that will use the generic member
> as long as the member exists in the base class. However, consider the
> case in which memberA, memberB, ..., memberL all exist while memberM,
> ..., memberZ have not yet been implemented. i do not have control of
> the relevant library but would like to be able to set up a generic
> template rather than have to write a unique one for each member.

I don't think you can have it both ways. You can pass a member name
in the form of a pointer to member function. But if you spell it
out in your code and it doesn't exist, you will get a compile error.
Or, you can specify it in a SFINAE expression without the compile
error but you have to spell it out. Perhaps you can use the first
approach for the implementation and the second as a thin wrapper
over it (maybe with some macros to shorten things up even more).

Boris



More information about the xsd-users mailing list