Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Vec3f {
- Vec3f() : Vec3f(0, 0, 0) {}
- Vec3f(float x, float y, float z) : x(x), y(y), z(z) {}
- Vec3f& operator=(const Vec3f& v) = default;
- Vec3f& operator=(Vec3f&& v) = delete;
- Vec3f(const Vec3f& v) = default;
- Vec3f(Vec3f&& v) = delete;
- ~Vec3f() = default;
- float x, y, z;
- };
- Vec3f sum(const Vec3f& a, const Vec3f& b) {
- Vec3f out(0, 0, 0);
- out.x = a.x + b.x;
- out.y = a.y + b.y;
- out.z = a.z + b.z;
- return out;
- }
- int main(int argc, char **argv) {
- Vec3f a(1, 2, 3), b(4, 5, 6);
- Vec3f c = sum(a, b);
- return c.x > 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement