1 of 2

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

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.