4
« on: April 09, 2013, 07:24:23 am »
I want to make my own library that has functions. I'm very particular about function names, but heres the thing, some of the function names I want to use are already used in another library/file that is included in the program.
Thing is, I don't want to modify included libraries that are not mine or affect how they work (since I will need to use their version of the function too).
In a nutshell it's like this (example!):
External Library has a round() function (for rounding numbers).
My Library also has a round() function which USES the round() function from the external library (mine uses it, but works slightly differently)!
.. and then, in my main.cpp program, if I call round() I want it to know I'm referring to MY library (not the other 'External' library). And I don't want to have to refer to my functions using long/additional tags like: myLibrary::round().
If I do use namespace tags etc, anywhere in my code, I'd rather it be for the External library functions. But remember, I don't want to edit their library or cause it to not work anymore (since I'm guessing their library (and maybe several other libraries also makes use of that functions without knowing of any changes/additions in namespaces!). Basically I don't want to screw all the other libraries up which aren't mine.
How can I overcome this??
Thanks in advance,
Tom