SFML community forums
Help => General => Topic started by: dreta on December 18, 2011, 05:14:02 pm
-
hey,
i'm not a C++ expert, i don't know any tricks of the trade or anything beyond what you read in the books. what i'd like to know is, reading the tutorials, is it alright for me to use a namespace for sfml? why isn't it used in the tutorials, is it bad practice? does it colide with standard libraries?
-
Generally, good practice is to use sf:: before SFML identifiers. This makes clear to what library a function, type or object belongs, and avoids potential name collisions.
You should write using namespace carefully, and never in headers (because it pollutes the global namespace of all the files including the header).