Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLion Custom Function Template Generation?

Tags:

c++

clion

Is there a way in CLion to create custom function templates for easily inserting a lot of repetitive junk from a parameter or more? As an example the following would ideally take a parameter of FUNCTION_NAME:

/*
* FUNCTION_NAME
* 
*/
void FUNCTION_NAME() {
    try {

    } catch (CustomException e) {
        e.StackTrace.Add("at FUNCTION_NAME");
        throw e;
    }
}
like image 623
CoryG Avatar asked May 19 '26 09:05

CoryG


1 Answers

CLion supports live templates The sequence of actions for your case is shown in the picture

like image 141
uta Avatar answered May 22 '26 00:05

uta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!