Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Replace use of raw deletable pointers in readDataCooked with shared/weak ptrs #1058
Summary of the new feature/enhancement
In Module Name (readDataCooked.hpp), there is a // TODO MSFT
Proposed technical implementation details (optional)
In project Host, I would like to encapsulate the _commandHistory raw pointer to CommandHistory as a std::shared_ptr.
The main change propagation problem is that:
Should I transform it as a :
or should I return a weak_ptr... I would be dirty ! What is your opinion ? The History() fn is used to get the reference and some function use the reference. It's not a problem to change the reference as a shared_ptr, its just the fact I need to make more job. The idea is to be clean so I would prefer to propagate shared_ptr. For a ISO C++, it's better. weak_ptr should be used for legacy stuff thunking layers stuff but for new C++ project, unique_ptr<> & shared_ptr<> everywhere is the rule.
Tell me and I can do it.
There are changes to propagate because the pointer is used as that (Find In Files):
I haven't heard the guidance before that
Personally, I think this might be an ideal
I can be convinced otherwise as well. I'm honestly not super familiar with
Finally, I think that in order to accomplish this successfully, you will likely have to change the way that
May 30, 2019
Question ? I am new to contribution so here is my question... Can I start working on my local branch or should we continue the discussion about how I will do about impact & more ?
Yeah, my branch
On the contribution side, in order to reduce conflicts of effort we encourage people to open up a github issue to chat with us before making code changes. This scenario where I have a branch with large changes in the related area is a good example of that. So we definitely appreciate you reaching out to us first! What I would encourage is for you to take a look at the branch I mentioned above so you can see the way we envision the code in that area evolving and if you believe you can convert the history pointer to a smart pointer without too much code conflicts then you're more than welcome to try. And of course we'll be around to help with questions and whatnot.
Hello @adiviness, I have made the various shared_ptr propagation, and -> and (*it) transformation in host and unit tests on my fork of your branch 'dev/austdi/NewCookedRead'.
We use TAEF for our tests, I believe it's a nuget package in