I think writing a global smart pointer std::shared_ptr sp1 = sp would also not be atomic in case the write takes place from multiple threads. The smart pointer class object is subject to tearing. So you need to use atomic_load() (C++11) or atomic shared pointers (C++20).
Thanks a lot, I¡m doing a course form Udemy and here is more clear, thanks a lot. I see the videos have now a lot more of quality... Thanks for your work is really helpfull.
Hello. You forgot to mention about that you can use a deleter function then you create a share pointers, and the profit of using a make_shared function.
hy bro excellant explanation....please clear my doubt bro ... why you are using dot operator for use_count instead of arrow operator because my understanding is sp is a pointer so we must use arrow operator to deference anything . thanks cppnuts
Arrow operator is for managed object, and dot operator is for SP class it self. Because we have object of SP so we can use dot operator to access member functions of SP class.
Hi Rupesh, Interviewer Asked me a question What is the actual use of reference count when it will be useful what you will do by knowing the count. where you will use?
Reference count is used to protect your variable from deleting. Meaning if your variable is being referenced somewhere then it should not be deleted so we keep the reference count to find if some where this variable is being used.
at the end of the video u have added lock guard to the thread function but did not explain, i think its to make the managed object as thread safe? correct me if i am wrong
Exact explanation, thank you so much for your effort, like the term manageable object.
Thanks dude..
Next level explaination bro🔥🔥🔥 and next level accent as well😂
Theenkksss
I think writing a global smart pointer std::shared_ptr sp1 = sp would also not be atomic in case the write takes place from multiple threads. The smart pointer class object is subject to tearing. So you need to use atomic_load() (C++11) or atomic shared pointers (C++20).
Thanks a lot, I¡m doing a course form Udemy and here is more clear, thanks a lot. I see the videos have now a lot more of quality... Thanks for your work is really helpfull.
Great to hear!
cleared all concepts. Thanks a lot. please one video on "Lamba expression in details which is introduced in C++ 11"
Will upload soon!! Actually i thought i have already given this video, thanks dude.
Hello. You forgot to mention about that you can use a deleter function then you create a share pointers, and the profit of using a make_shared function.
Well explained, thank you.
Thanks man!!
Can you please tell, What is the IDE you use for compilation?
Question about 4.b point
why it should detroy managed object if initialzed with some other shared_ptr?
great video. thank you!
Welcome
Thanks sir ~Well explained.
Glad it was helpful!
bro @CppNuts how you told -> is overloaded??. Just Curious:)
hy bro excellant explanation....please clear my doubt bro ...
why you are using dot operator for use_count instead of arrow operator because my understanding is sp is a pointer so we must use arrow operator to deference anything . thanks cppnuts
Arrow operator is for managed object, and dot operator is for SP class it self. Because we have object of SP so we can use dot operator to access member functions of SP class.
@@CppNuts thanks a lot brother got it .....
Hi Rupesh,
Interviewer Asked me a question What is the actual use of reference count when it will be useful
what you will do by knowing the count. where you will use?
Reference count is used to protect your variable from deleting. Meaning if your variable is being referenced somewhere then it should not be deleted so we keep the reference count to find if some where this variable is being used.
Yes very well explained cleared up some confusion thank you! : D
Glad it was helpful!
Can you make a video on "
" vs endl?
Sure..
In Foo destructor pointer deletion s required r is it taken care by smart pointers,
If so y destructor is called.
Thank u
could you please give me a hint on line 25 constructor. i am new to this
at the end of the video u have added lock guard to the thread function but did not explain, i think its to make the managed object as thread safe? correct me if i am wrong
I checked with cplusplus, I think the syntax shown in thumbnail of the video is not correct.
Correct..
I will change it thanks man..
In hurry it happens.. 😁
Is it possible to copy vector data... So that we can pass shared in function
Std::make_shared
Bro please tell where you studied , this much detailed, i want to read..
Stackoverflow 😂
I'll have to go 20 seconds back because i was reading comment instead of watching the video 😂
Nice explanation, Is there any way to get the program source file ?
Yes please check channel about page.
when are you making videos on deleter / custom deleters ?
It will take time, now i am working on DS.
sir we conduct the online classes? give me the replay plz
Objaaaact!!!!
Please do not use foo bar func as names. This is the reason most people don’t understand the real world usage.
Sure!!
two much ads bro
Sorry dude!!
Good explanation. But dont have this fake accent while you are presenting something
Kuch cheeze nahi badal sakta hu.. :P