-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
First of all, thank you to everyone involved in the development of the C++ Core Guidelines and the GSL. Your work is invaluable and will undoubtedly be appreciated by generations of C++ programmers to come. With that in mind, I am concerned about the advice in the guidelines regarding the use of pointers, and have written a document outlining my thoughts, which can be summarised as:
- Using
T*
to represent "single objects" in high-level C++ code is less than ideal - We can use the type system to enforce correctness at compile-time and document intent in-code
- There may be value in slightly rethinking the approach to annotations such as
owner<T>
This document has been some time in the works, and has undergone many revisions, but it is now in a state that I am happy to share here. I would very much appreciate your consideration of my ideas, and welcome any comments or feedback. I believe it to be of utmost importance that the advice laid out in the guidelines is the best it can be. Please follow the link below to find the document with accompanying source code and unit tests.
[GitHub] Pointers and the C++ Core Guidelines
Joseph