Say I have a string, how do I generate all the combinations of its characters?
example: I have a string "Tea",how do I get:"tea","tae","ate","eta","eat","aet"
@Ericool you do not need to implement your own swap function (and it is not recomended to do it in global namespace. At least name it differently). Just use iter_swap: http://en.cppreference.com/w/cpp/algorithm/iter_swap