fork(1) download
  1. #include <iostream>
  2. #include <typeinfo>
  3.  
  4. struct Demo {
  5. void none() { std::cout << typeid(this).name() << "\n"; }
  6. void c() const { std::cout << typeid(this).name() << "\n"; }
  7. void v() volatile { std::cout << typeid(this).name() << "\n"; }
  8. void cv() const volatile { std::cout << typeid(this).name() << "\n"; }
  9. };
  10.  
  11. int main() {
  12. Demo d;
  13. d.none();
  14. d.c();
  15. d.v();
  16. d.cv();
  17. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
P4Demo
PK4Demo
PV4Demo
PVK4Demo