the simplest solution I can think of is to provide two libraries but that is a burden for the developer.
Another way is to use a templates. A very short intro see
-
http://www.cplusplus.com/doc/tutorial/templates/ - at the end of the page
or - C++ Templates -