Marsh Posted April 1, 2015 Author Share Posted April 1, 2015 C++14 Whitespace OverloadingThis is an old idea from Bjarne Stroustrup (Creator of c++) finally making it into the standard. The idea is to be able to write:x yto mean "multiply x by y". The implementation is simple:```float operator (float a, float b) { return a * b; }```or more explicitly:```float operator ' '(float a, float b) { return a * b; }```There are actually much more to Stroustrup proposal, which I suggest you to read: [http://www.stroustrup.com/whitespace98.pdf](http://www.stroustrup.com/whitespace98.pdf). It's an interesting and good read, and depending on your mindset and personality, it can also be a good laugh.Even if not all the compilers on the floor actually fully support C++14, You should use whitespace overloading anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now