-
Star
(1,246)
You must be signed in to star a gist -
Fork
(72)
You must be signed in to fork a gist
-
-
Save bkaradzic/2e39896bc7d8c34e042b to your computer and use it in GitHub Desktop.
GCC and clang should introduce new switch: /orthodox
@DBJDBJ what would the flag do ?
This should be the default way of doing C++
Feature creep is never good.
GCC and clang should introduce new switch: /orthodox
@DBJDBJ what would the flag do?
Enforce "all" the "rules" discussed here. The very first post on this page explains it. I would also add: bar std::
Yo, hopping in the discussion, my style is that I just use std::vector and string and things like that. I think that using them is very nice and they don't really have many problems for 99% of use cases, writing them is horrible tho, so I would never write them. So basically I write C with methods, operation overloading, vectors, lambdas, std::file_system and one time a year templates ๐. I also never use destructors.
@bkaradzic , I have a small doubt I wish to ask you. Heap fragmentation is a problem when it comes to STL, so why not write something to a bump allocator? Have a continuous block of memory, and when a
reallocis requested, if requested size is bigger than existing, expand the pool, move it to the end and get rid of the hole in between (usingmemmove).
A simple implementation of this comes with asmjit. See Zone, ZoneAllocator, ZoneVector, ZoneHash, ZoneString. It is used in what amounts to compiler-class code that has to be light and fast. It delivers on that.
Question @bkaradzic : What would be considered "selective" use of C++20? I'm planning on upgrading my C++ version for a game engine I'm working on. Any particular features in mind, or just keep using features that existed in C++17 that might have additional power in C++20 (for example, updates to constexpr)?
As a side note, personally, struct/enum/union without typedef, reference parameters, and constexpr are all I use from C++.
GCC and clang should introduce new switch: /orthodox
I've implemented it, pretty much. See https://github.com/d-musique/orthodoxy
It does the enforcement of programming rules that you mention.
It's quite recent and it works for me well. This thing was born out of extreme frustration with the ongoing ens*ittification of C++ to a point that I could no longer accept it.
This lead me to revise my approach to C++ programming to a large degree, and I judged this kind of tool to increasingly become a necessity. This has been on my mind for maybe a year or so but finally I dedicated some time so I could bring it to reality.
@d-musique Excellent! ๐
GCC and clang should introduce new switch: /orthodox