Tools
- Sandbox
- Paste Code
- Snippets
- Generators
- Checks
- Convertors
[cpp] operator
Viewer
- struct Vec3
- {
- float x, y, z;
- //negative operator
- Vec3 operator -() const { return Vec3{-x, -y, -z}; }
- //subtract operator
- Vec3 operator - (const Vec3 & r) const { return Vec3{x - r.x, y - r.y, z - r.z}; }
- };
Editor
Share
Do you find this tool useful? Then share it with your friends or colleagues. This will help us to make our free web tools better.
You can edit this paste and save as new:
Information about embedding
In order to embed this content into your website or blog, simply copy and paste one of the codes provided below.
1. JavaScript Embedding (shows full code, full height depending on amount of lines in paste)
<script src="https://wtools.io/code/embed-js/b1ln"></script>
2. Iframe Embedding (you can set the frame height by adding the CSS value 'height:100px;' for example)
<iframe src="https://wtools.io/code/embed-iframe/b1ln" style="border:none;width:100%"></iframe>
File Description
- operator
- Paste Code
- 23 May-2020
- 219 Bytes
You can Share it: