MCPcopy Create free account
hub / github.com/FastLED/FastLED / shared_ptr

Method shared_ptr

src/fl/stl/weak_ptr.h:209–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207template<typename T>
208template<typename Y>
209shared_ptr<T>::shared_ptr(const weak_ptr<Y>& weak) : mPtr(nullptr), mControlBlock(nullptr) {
210 if (!weak.expired()) {
211 if (weak.mControlBlock && weak.mControlBlock->shared_count > 0) {
212 ++weak.mControlBlock->shared_count;
213 mPtr = weak.mPtr;
214 mControlBlock = weak.mControlBlock;
215 }
216 }
217 if (!mPtr) {
218 // If construction failed (object was destroyed), throw bad_weak_ptr equivalent
219 // For now, just leave as default-constructed (nullptr)
220 }
221}
222
223} // namespace fl

Callers

nothing calls this directly

Calls 1

expiredMethod · 0.80

Tested by

no test coverage detected