Created
March 2, 2023 04:02
-
-
Save hydranix/87eed6c5c38cb52c7ba98a159302647e to your computer and use it in GitHub Desktop.
Regex to convert C++ const-ref parameter signature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I wanted an easy way to change the ordering of a bunch of | |
const ref function parameters in visual studio | |
warning: not all corner cases are covered, use it carefully | |
Search for: | |
(const)\s+(\w+)(&)\s+(\w+[^\w]) | |
Replace with: | |
$2 $1$3 $4 | |
Original: | |
void FuncName(const typename& arg1, const typename& arg2, | |
typename&& arg3, | |
const typename& arg4 = defaultval) const | |
Replaced: | |
void FuncName(typename const& arg1, typename const& arg2, | |
typename&& arg3, | |
typename const& arg4 = defaultval) const |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment