fork(2) download
  1. #include <iostream>
  2. #include <cmath> // Uses ::log, which would be the log() here if it were not in a namespace, see http://stackoverflow.com/questions/11892976/why-is-my-log-in-the-std-namespace
  3.  
  4. // Silently overrides std::log
  5. //double log(double d) { return 420; }
  6.  
  7. namespace uniquename {
  8. using namespace std; // So we don't have to waste space on std:: when not needed.
  9.  
  10. double log(double d) {
  11. return 42;
  12. }
  13.  
  14. int main() {
  15. cout << "Our log: " << log(4.2) << endl;
  16. cout << "Standard log: " << std::log(4.2);
  17. return 0;
  18. }
  19. }
  20.  
  21. // Global wrapper for our contained code.
  22. int main() {
  23. return uniquename::main();
  24. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
Our log: 42
Standard log: 1.43508