I have a preprocessing code to choose which vector class is used as following:
#define USE_BOOST_VECTOR
#ifdef USE_BOOST_VECTOR
#include <boost/container/vector.hpp>
#define VECTOR boost::container::vector
#else
#include <vector>
#define VECTOR std::vector
#endif
I am not sure if this is a good way. And how about if I have more options to choose, what should I do?
Figured out if there are more options
#define USE_MY_VECTOR 1
#define USE_BOOST_VECTOR 2
#define USE_STD_VECTOR 3
#define CHOOSE_VECTOR USE_BOOST_VECTOR
#if CHOOSE_VECTOR == USE_MY_VECTOR
#include "Vector.h"
#define VECTOR Vector
#elif CHOOSE_VECTOR == USE_BOOST_VECTOR
#include <boost/container/vector.hpp>
#define VECTOR boost::container::vector
#elif CHOOSE_VECTOR == USE_STD_VECTOR
#include <vector>
#define VECTOR std::vector
#endif
But I need to define 1, 2, 3, and more for more options. Just for a brain work, any better way?