Modern gcc compiler on Travis CI

I recently needed to setup Travis CI for a little pet project I'm working on. However, my code requires C++17 (yeh, I'm nuts), and the compiler suite that comes with the various Travis images do not satisfy this. Long story short, there are ways around this, forcing the installation and activation of gcc8 on Xenial. Example:

dist: xenial
language: cpp
compiler: gcc

  - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  - sudo apt-get update -qq
  - sudo apt-get install g++-8 libstdc++-8-dev
  - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90
  - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90

install: autoreconf -if

script: ./configure && make -j4 && make test