Manual overload resolution in embedded assembler

Example 23 shows the use of C++ casts to do overload resolution for nonvirtual function calls:

Example 23.  C++ casts

void g(int);
void g(long);
struct T
{
    int mf(int);
    int mf(int,int);
};
__asm void  f(T*, int, int)
{
    BL __cpp(static_cast<int (T::*)(int, int)>(&T::mf)) // calls T::mf(int, int)
    BL __cpp(static_cast<void (*)(int)>(g)) // calls g(int)
    BX lr
}

Show/hideSee also

Copyright © 2007-2008, 2011 ARM. All rights reserved.ARM DUI 0375C
Non-ConfidentialID061811