The text itself needs to be fixed at macro expansion time, though you can use @eval
to build the text up dynamically. That said, the best solution to your problem is probably to use the julia-side representation of the C++ type:
s = cxxt"gm2truth::SomeOtherType"
tracks = icxx"return $(he.galleryEvent).getValidHandle<$s>($(trackingActionSpect.artInputTag));"
which should work well, because the text is fixed at macro expansion time (though the s
is allowed to vary at runtime).