Comments (5)
Thank you for looking into this as well. I'm thinking we could just force #pragma once
into new header files? It's 2018 anyway, and the important compilers have supported it for quite a while?
from jucipp.
I created header guards because I have some project with stupid guidelines that I didn't want to break. In case of my project you are right. Good habits and simplicity should be promoted, and nothing bad gonna happen if some unrelevant guidelines will be broken.
I just wonder if there are some projects, where (from legacy or some different reasons) it is really not possible to use #pragma once. Maybe for that reason it is good to left small window for code with header guards and just left the code in the way I wrote it (without some complex logic for discovering what kind of guards given project use).
What do you think?
from jucipp.
The only cases I can think of is when using really old compilers, or if one header file is split into several in a weird build setup. But I think it's safe to just add #pragma once
if an empty header file is opened (for instance in Source::ClangViewParse::ClangViewParse()
. It definitely will help a lot of new C++ programmers that tend to forget this (and get strange errors because of it). And in cases where it is not wanted, one can simply push undo or remove it manually.
from jucipp.
Good thinking. Thank you.
from jucipp.
I implemented my proposal in the commit above. I'm thinking it is better to have it than not:)
from jucipp.
Related Issues (20)
- c++17 features and autocomplete HOT 3
- close all open files when loading a new folder / project HOT 4
- Multicursor support HOT 3
- Console color escape codes with CMake build. HOT 1
- "Better" semantic highlighting
- highlight name clicked on HOT 3
- Supporting C/C++ language server: cquery HOT 1
- mac Undefined symbols for architecture x86_64 HOT 2
- Submodules not included in archive tarball HOT 1
- Is there a way to change colors? HOT 1
- MSYS2: Build instructions need updating HOT 4
- select enclosing c/c++ element HOT 1
- copy/cut whole line with cursor if nothing is selected HOT 6
- no shortcuts prompt in menu HOT 5
- drive icons in all open file/folder dialog are not working HOT 1
- Suggest of reimplementing the CMake support with cmake-server HOT 7
- `noexcept` not preserved when implementing method HOT 5
- failing compilation on msys2 HOT 2
- Crash when closing open files HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jucipp.