fork download
  1. include <iostream>
  2.  
  3. // used as conversion
  4. constexpr double operator"" _deg ( double deg )
  5. {
  6. return deg*3.141592/180;
  7. }
  8.  
  9.  
  10. int main(){
  11. double x = 90.0_deg;
  12. std::cout << x << '\n';
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: 'include' does not name a type
 include <iostream>
 ^
prog.cpp: In function 'int main()':
prog.cpp:11:16: error: unable to find numeric literal operator 'operator""_deg'
     double x = 90.0_deg;
                ^
prog.cpp:12:5: error: 'cout' is not a member of 'std'
     std::cout << x << '\n';
     ^
stdout
Standard output is empty