That's a really nice one!
Thank you.
Compiling does work with Clang++ but not with G++.
I'm curious to know how that does not work with g++. it works fine for me on multiple Linux distributions - for example on CentOS 7 with g++ 4.8.2 :
[jj@jj src]$ g++ --version
g++ (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[jj@jj src]$ g++ -std=c++11 -O3 -lsfml-window -lsfml-graphics -lsfml-system -o bounce bounce.cc
[jj@jj src]$ ./bounce
[jj@jj src]$ echo $?
0
What errors are you getting exactly?
Compiler errors? Linker errors? Runtime errors?
I'd really like to know so I can revise the example so it works perfectly for everyone as it is supposed to...