| June 16, 2003 | ||
| Metacode injection and decltype | ||
Until last Thursday, continuing the metacode implementation hadn't made it to the top of my todo list for a while. Fortunately, the folks at the Open Systems Lab (OSL) at Indiana University invited me for a visit to talk about metacode and other C++ language issues. Besides the opportunities for discussion, this also got me into airplanes, airports, and hotels, which is always the perfect venue for writing code. |
||
|
As a result of this coding the metacode interpreter (embedded in the compiler) now supports a few more C++ constructs. I also added the metacode
int mypow(int b, int n) {
using ::stdmeta::is_constant;
if (is_constant(b) &&
is_constant(n) &&
n >= 0) {
return power<>(b, (unsigned)n); // Compile-time
} else {
return-> ::std::pow((double)b, (double)n);
}
}(I wish I could write the example above with type While chatting about all these things, we also ended up rehashing some aspects of the Eventually we whipped up a couple of implementations of |
||
|
Posted by Daveed at 09:43 AM
| Comments (0)
|
||