I\'m looking for a way to simulate certain overloaded GCC built-ins in C++. The built-ins are similar to these:
__builtin_foo(char *a, signed int b);
__buil
You could turn the function into a template:
template
builtin_foo(char *a);
The call syntax would then be builtin_foo<1>(whatever)
.
If you don't like this, you could wrap the template in a macro:
#define m_builtin_foo(a, b) builtin_foo<(b)>((a))
This will of course accept any integral constant expression, not just a literal.