fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. template<int size,typename basic_type=unsigned int,typename long_type=unsigned long long,long_type base=256>
  5. class NSize
  6. {
  7. template <int lengthA, int lengthB>
  8. friend NSize<lengthA + lengthB> operator * (const NSize<lengthA> &a, const NSize<lengthB> &b);
  9.  
  10. public:
  11. NSize(basic_type){}
  12. };
  13.  
  14. template <int lengthA, int lengthB>
  15. NSize<lengthA + lengthB> operator * (const NSize<lengthA> &a, const NSize<lengthB> &b)
  16. {
  17. return NSize<lengthA + lengthB>(0);
  18. }
  19.  
  20. int main() {
  21. NSize<30> a(101);
  22. NSize<25> b(120);
  23. NSize<30> c(115);
  24. auto res = (a*b)*(a*c)*(c*b)*(b*a)*(a*c);
  25. }
  26.  
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty