I am currently writing a library that will sometimes be used alongside OpenCV. Because OpenCV defines a Point_ class that is commonly used in some of the contexts my library will be used in, I'd like to add the option to pass in Point_s as arguments to some of my functions. That said, OpenCV is a pretty heavy library and I'd very much prefer not to depend on it just to get access to it's Point_ class.
Defining my own Point_ identical Point_ class causes the expected multiple definition error.
I considered using a pre-processor macro to check if the OpenCV header containing Point_ has already been included and only define it if it has not been, but I'm concerned that if my libraries header is included first, the multiple definition error will return and this will make my library difficult to use for anyone other than myself.
Is there a way to provide a definition that will only be used if there is not definition anywhere else, and/or will be overridden if one does appear elsewhere?