title: Is there a reason to use C++11's std::int_fast32_t or std::int_fast16_t over int in cross-platform code?
body: <p>In C++11 we are provided with fixed-width integer types, such as <code>std::int32_t</code>and <code>std::int64_t</code>, which are optional and therefore not optimal for writing cross-platform code. However, we also got non-optional variants for the types: e.g. the "fast" variants, e.g. <code>std::int_fast32_t</code>and <code>std::int_fast64_t</code>, as well as the "smallest-size" variants, e.g. <code>std::int_least32_t</code>, which both are at least the specified number of bits in size.</p>
  
  <p>The code I am working on is part of a C++11-based cross-platform library, which supports compilation on the most popular Unix/Windows/Mac compilers. A question that now came up is if there is an advantage in replacing the existing integer types in the code by the C++11 fixed-width integer types.</p>
  
  <p>A disadvantage of using variables like <code>std::int16_t</code> and <code>std::int32_t</code> is the lack of a guarantee that they are available, since they are only provided if the implementation directly supports the type (according to <a href="http://en.cppreference.com/w/cpp/types/integer" rel="noreferrer">http://en.cppreference.com/w/cpp/types/integer</a>).</p>
  
  <p>However, since <code>int</code> is at least 16 bits and 16-bit are large enough for the integers used in the code, what about the usage of <code>std::int_fast16_t</code> over int? Does it provide a benefit to replace all <code>int</code> types by <code>std::int_fast16_t</code> and all <code>unsigned int</code>'s by <code>std::uint_fast16_t</code> in that way or is this unnecessary? </p>
  
  <p>Anologously, if knowing that all supported platforms and compilers feature an <code>int</code> of at least 32 bits size, does it make sense to replace them by <code>std::int_fast32_t</code> and <code>std::uint_fast32_t</code> respectively?</p>