I am trying to do something like this:
#include
#include
typedef int Integer;
#if sizeof(Integer) <= 4
typedef std::
Use the std::conditional meta-function from C++11.
#include //include this
typedef std::conditional::type Engine;
Note that if the type which you use in sizeof is a template parameter, say T, then you have to use typename as:
typedef typename std::conditional::type Engine;
Or make Engine depend on T as:
template
using Engine = typename std::conditional::type;
That is flexible, because now you can use it as:
Engine engine1;
Engine engine2;
Engine engine3; // where T could be template parameter!