This post contains easiest way of upgrading gcc to latest on apple computer. I have a apple laptop which is given to me by my employer. It comes with a very old version of gcc (4.2). It does not suppport latest and greatest of c++. I realised this when I wanted to try some code but it did not compiled.
So here are the bare minimum step you would like to do if you are in same situation as I was.
Check if you mac port installed? If it is not there, install it from here. It will be also great if if you do self update post installation.You may need to update the PATH variable, it goes to /opt/local/bin.
When this is done.. you need to update port selection to select newly installed port.
And last step is to update enviornment variables if needed. You are done!!
Here are commands, all the best
for questions/correction email me vikrant.subscribe at gmail.