Guest User

Untitled

a guest
Jun 27th, 2015
287
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Time {
  2.   public:
  3.   float value;
  4.  
  5.   Time(float f):value{f}{}
  6.   Time operator +(Time b) const
  7.   { return value + b.value; }
  8.   operator float() const
  9.   { return value; }
  10. };
  11.  
  12. float f(float a, float b)
  13. { return a + b; }
  14.  
  15. float g(Time a, Time b)
  16. { return a + b; }
  17.  
  18.  
  19. Result: (with gcc.godbolt.org)
  20. f(float, float):
  21.     addss   %xmm1, %xmm0
  22.     ret
  23. g(Time, Time):
  24.     addss   %xmm1, %xmm0
  25.     ret
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×