find ./ -type f -exec \under a folder, do an exact match, and recursively replace to a new word.
sed -i 's/\<map\>/unordered_map/g' {} +
The motivation was this: I want to upgrade my source code to C++11. To be more efficient, all the old <map> header and usage, which is log(n), should be replaced by the new hash function in <unordered_map>. But there are other names with prefix or postfix "map", which should not be changed.
No comments:
Post a Comment