GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — make_cpp_nice/README.md at main · make-cpp-nice/make_cpp_nice

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
26 lines (19 loc) · 2.31 KB
/

README.md

Copy path

File metadata and controls

26 lines (19 loc) · 2.31 KB
Raw
Copy raw file
Download raw file
Edit and raw actions

Library utilities, methodologies and guidelines to make C++ nice to work with.

Single header Library utilities:

  • ptr_to_unique - A smart pointer to an object already owned by a unique_ptr. It doesn't own the object but it self zeroes when the object is deleted so that it can never dangle.
  • numerical conversions - A set of dedicated numerical conversions that are a better choice than the canonical application of static_cast.
  • literal integral constants - Converts literal constants into std::integral_constant using a double underscore suffix, e.g. 4__

Some thoughts:

  • Safe is nice. That doesn't have to be the bullet proof provable safety of Rust. A more humble aim that with reasonable care safety hazards can easily be avoided would be a big improvement on the status quo. So hazards of pointer, memory or data corruption should be well controlled and easy to avoid. The problem that needs addressing with C++ is not that you can shoot yourself in the foot, it is that it can be difficult not to shoot yourself in the foot.
  • Identifiers should be named so that someone uninitiated has a good chance of guessing what they mean.
  • What you think in one sentence, you should be able to write in one line and it should look like what you thought. If you read it out load it should sound like a description of what your code does.
  • Coding should not be laborious. You should not have to code much more than what you are thinking. But don't try to cram more onto one line than the mind can comfortably grasp.
  • Learning curves should be short and provide early rewards.
  • Some clever and useful C++ constructs are difficult to decipher. Use them if they serve your purpose but encapsulate it so others don't have to go there.
  • Always prefer existing standard solutions but if they don't meet your needs then find or create something that does.

Please post any feedback or comments on Comment and discussion

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.