#include <iostream>
using namespace std;
class DynamicInteger;
template <int L>
class StaticInteger {
public:
StaticInteger(int x) {}//bla bla
template <int M>
StaticInteger<L> operator+(StaticInteger<M> x) {}
//operator DynamicInteger () const;
private:
//bla bla
};
class DynamicInteger {
public:
template <int M>
DynamicInteger (StaticInteger<M> m ) { cout<<"construct Dynamic from "<< M<<endl; }
DynamicInteger operator+(DynamicInteger x) {}
private:
};
//template <int M>
//StaticInteger<M>::operator DynamicInteger () const { return DynamicInteger(*this);}
int main() {
StaticInteger<16> a = 10, b=20;
StaticInteger<16> c = a+b;
DynamicInteger x = a;
DynamicInteger z = x + b;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgRHluYW1pY0ludGVnZXI7IAoKdGVtcGxhdGUgPGludCBMPgpjbGFzcyBTdGF0aWNJbnRlZ2VyIHsKcHVibGljOgogIFN0YXRpY0ludGVnZXIoaW50IHgpIHt9Ly9ibGEgYmxhCiAgdGVtcGxhdGUgPGludCBNPgogIFN0YXRpY0ludGVnZXI8TD4gb3BlcmF0b3IrKFN0YXRpY0ludGVnZXI8TT4geCkge30KICAvL29wZXJhdG9yIER5bmFtaWNJbnRlZ2VyICgpIGNvbnN0Owpwcml2YXRlOgogIC8vYmxhIGJsYQp9OwoKY2xhc3MgRHluYW1pY0ludGVnZXIgewogcHVibGljOgogICAgdGVtcGxhdGUgPGludCBNPgogICAgRHluYW1pY0ludGVnZXIgKFN0YXRpY0ludGVnZXI8TT4gbSApIHsgY291dDw8ImNvbnN0cnVjdCBEeW5hbWljIGZyb20gIjw8IE08PGVuZGw7IH0gCiAgICBEeW5hbWljSW50ZWdlciBvcGVyYXRvcisoRHluYW1pY0ludGVnZXIgeCkge30KIHByaXZhdGU6Cn07CgovL3RlbXBsYXRlIDxpbnQgTT4KLy9TdGF0aWNJbnRlZ2VyPE0+OjpvcGVyYXRvciBEeW5hbWljSW50ZWdlciAoKSBjb25zdCB7IHJldHVybiBEeW5hbWljSW50ZWdlcigqdGhpcyk7fQoKaW50IG1haW4oKSB7CgkKCVN0YXRpY0ludGVnZXI8MTY+IGEgPSAxMCwgYj0yMDsgCglTdGF0aWNJbnRlZ2VyPDE2PiBjID0gYStiOyAKCUR5bmFtaWNJbnRlZ2VyIHggPSBhOwoJRHluYW1pY0ludGVnZXIgeiA9IHggKyBiOwoJcmV0dXJuIDA7Cn0=