bec*_*cko 10 pragma include-guards include header-files clion
默认情况下,CLion会将以下行添加到新创建的头文件中:
#ifndef SOME_NAME_H
#define SOME_NAME_H
.... your code here
#endif //SOME_NAME_H
Run Code Online (Sandbox Code Playgroud)
但我#pragma once更喜欢.如何配置CLion以便#pragma once默认使用新的头文件?
Cod*_*oka 12
去吧File-> Settings -> Editor -> File and Code Templates.你会发现有3个标签,分别是Templates,Includes和Code.现在Templates选择例如C头文件.插入#pragma once以替换其内容.现在,每次从项目菜单添加新的标题时,您都会拥有自己的模板.
| 归档时间: |
|
| 查看次数: |
3454 次 |
| 最近记录: |