I am stuck. The problem is to write a ternary metafiction replace_type<C,X,Y> that takes an arbitrary compound type C as its first parameter and replaces all occurrences of a type X with C with Y.
I have been working and for some simple types C I get it to work but then it seems there are infinite combinations of forms to create a compound C and do not know how to approach this general question. For specific cases, I can solve it but not for general cases
Regards,
Juan
P.S.: This exercise appears in "C++ Metaprogramming" by David Abrahams and Aleksey Gurtovoy...
2-1. Write a ternary metafunction replace_type<c,x,y> that takes an arbitrary compound type c as its first parameter, and replaces all occurrences of a type x within c with y:
Not sure whether you know that gentleguy is a troll, of closed_account infamy. Consider just ignoring anything that is said by this user - I'll bet he has no idea at all about TMP - any info that he does provide will just be misinformation. Perhaps you could privately approach someone who has helped you in the past ? Up to you to do whatever you want - just trying to help you wasting some time :+)