Skip to content

Instantly share code, notes, and snippets.

@mtimkovich
Created June 29, 2017 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtimkovich/7c6019f9c565644e0d658e5189163836 to your computer and use it in GitHub Desktop.
Save mtimkovich/7c6019f9c565644e0d658e5189163836 to your computer and use it in GitHub Desktop.
like go run but for c++
cpps() {
exe=/tmp/$(basename $1 .cpp)
g++ -std=c++11 -g -O0 $1 -o $exe || return 1
if [ -z "$2" ]
then
$exe
else
$exe "${@:2}"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment