fork(1) download
  1. #include <iostream>
  2.  
  3. class test
  4. {
  5. long double x;
  6. public:
  7.  
  8. friend test operator""_UNIT(long double v)
  9. {
  10. test t;
  11. t.x = v;
  12. return t;
  13. }
  14.  
  15. };
  16.  
  17.  
  18. int main()
  19. {
  20. test T = 10.0_UNIT;
  21.  
  22. return 0;
  23. }
  24.  
Compilation error #stdin compilation error #stdout 0s 3456KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:20:14: error: unable to find numeric literal operator 'operator""_UNIT'
     test T = 10.0_UNIT;
              ^
stdout
Standard output is empty