Use "#!/usr/bin/env hbcxx" to make C++ source code executable
...For simple programs, especially for quick and dirty personal toys, the day you have to write a proper build system may never come.
Instead just copy your C++ source code into $HOME/bin. Try it. It works.
WESP is a collection of subtle scripts and programs written in several languages (C, /bin/sh, (g)awk, ruby, icon) that breaths a new life into the WEB system for literate programming by Donald Knuth (and CWEB by Knuth/Sylvio Levy).