I recently made a little collection of functions which make my life with SFML easier.

SFML is my favorite library for graphical purposes, but I always wondered why there has to be so much code just to create a colorful rectangle or whatever so I decided to create a little library that helps me being faster.

Declaring parameters const is meaningful for references and pointers, but on the top-level (like const sf::Vector param) it clutters the interface with irrelevant information. The caller doesn't care whether the function modifies a copy of the value. For return types, const is not only useless, but also harmful, as it prevents move semantics (which can be relevant for more complex types).

I suggest to use this keyword only in the places where it actually expresses semantics, and not everywhere it fits. That helps making code more readable and understandable. Ironically, you are not using const in these places (e.g. the functions in the Mouse or Collision namespaces).

@StormWingDelta I'm not sure if it's necessary to return both coordinates in one function. Sometimes you just need one coordinate(For example in a space shooter[1D-movement]). If you convince me I'll add that.And I'm not sure what a line collision is good for.

@Nexus Thanks for this hint. I didn't really understood when to use const until now.

-Added circle collision-Added world/window-coordinates(also corrected the little mistake which I made in the first version)

Logged

If you're going to response to any of my comments, please avoid this smily: ""

It's always a good idea to explicitly state the license that code is made available under. Otherwise defaults according to many local laws may be that people have no rights to it at all (as far as I know).In the case where you just want to give it away with no strings attached, an explicit note that the code is placed in the public domain is probably the best option.(Just my opinion; I'm not a lawyer)