Comments (3)
I kind of like this. Are you suggesting that this be sort of like a 'diagnostic' that would let you know when the list is not in order and prompt you to auto-fix it? If not, this could probably be done with a simple command, given that the user already knows it's out of order. Also, I've heard conflicting information on whether or not the order of initializers actually matter, so I would want to confirm that first.
from vscode-cmantic.
I just looked it up, the standard says the order doesn't matter, here's the snippet from cppreference:
Initialization order
The order of member initializers in the list is irrelevant: the actual order of initialization is as follows:
- If the constructor is for the most-derived class, virtual bases are initialized in the order in which they appear in depth-first left-to-right traversal of the base class declarations (left-to-right refers to the appearance in base-specifier lists)
- Then, direct bases are initialized in left-to-right order as they appear in this class's base-specifier list
- Then, non-static data member are initialized in order of declaration in the class definition.
- Finally, the body of the constructor is executed
(Note: if initialization order was controlled by the appearance in the member initializer lists of different constructors, then the destructor wouldn't be able to ensure that the order of destruction is the reverse of the order of construction)
Found here: https://en.cppreference.com/w/cpp/language/constructor
Since the order doesn't matter, this becomes more of a 'style' issue, which I'll leave up to the code formatters. Thank you for the submission though. I'm going to close this.
from vscode-cmantic.
Okay, that's fair enough. My idea was indeed that it would be a diagnostic (at best). But yes, it's for style.
from vscode-cmantic.
Related Issues (20)
- Add case statements for enumeration in switch HOT 2
- Add Declaration doesn't including "static" keyword. HOT 2
- Move Implementations from Class header to source file HOT 1
- 'Add definition in this file' should not always add 'inline' when declaration is in CPP HOT 2
- Allow adding header guard relative to repo HOT 1
- Create matching header/source if not found
- Update function signature - option to keep parameter names in definition and declaration in sync
- [Feature] Extract code block to function/method HOT 1
- Weird double lines when using CRLF line endings
- C++ code is not detected. HOT 1
- [Feature] Create create no-args / required-args / all-args constructor
- "Add definition in xxx.cpp" doesn't work for template functions HOT 1
- Refactoring (Add Definition) began to work strangely. I can't find the reason HOT 7
- [Feature Request] CopyConstructor / assigment operator HOT 2
- [Bug] If I use the terminal after installing the extension, CPU usage increases abnormally.
- [Feature request] Please add UUID as a header guard component
- [Bug] Does not generate matching functions correctly HOT 9
- [BUG] Update function declaration doesn't follow `using` declarations.
- Getter/setter customization HOT 1
- Availability in gitpod - not registered at open-vsx.org
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 vscode-cmantic.