Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Time {
- public:
- float value;
- Time(float f):value{f}{}
- Time operator +(Time b) const
- { return value + b.value; }
- operator float() const
- { return value; }
- };
- float f(float a, float b)
- { return a + b; }
- float g(Time a, Time b)
- { return a + b; }
- Result: (with gcc.godbolt.org)
- f(float, float):
- addss %xmm1, %xmm0
- ret
- g(Time, Time):
- addss %xmm1, %xmm0
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement