A possible way to help portability could be to rely *only* on declarations and features provided by the [C++11][1] standard, and by using cross-platform libraries and frameworks like [POCO][2] & [Qt][3].

But even this is not fail-proof. Remember the aphorism

> there is no such thing as a portable program, there are only programs which have been successfully ported (to some particular platform)

With practice, discipline and a lot of experience, porting a program to another platform could *usually* be done quickly. But experience and know-how matters a lot.

  [1]: https://en.wikipedia.org/wiki/C%2B%2B11
  [2]: http://pocoproject.org/
  [3]: http://qt.io/