You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
copy_counting_object( const copy_counting_object<OutputType, InputType>& other ):
copy_count(other.copy_count + 1), is_copy(true) {
++other.copies_count;
}
If I'm reading this correctly, the copy constructor does not initialize copies_count. That means if you make a copy of a copy, the new object will do ++other.copies_count; on an uninitialized variable.
Is there any reason not to initialize copies_count to zero here?
Using default member initializers for all four data members seems sensible.
The text was updated successfully, but these errors were encountered:
oneTBB/test/conformance/conformance_flowgraph.h
Lines 335 to 351 in 1f52f50
If I'm reading this correctly, the copy constructor does not initialize
copies_count
. That means if you make a copy of a copy, the new object will do++other.copies_count;
on an uninitialized variable.Is there any reason not to initialize
copies_count
to zero here?Using default member initializers for all four data members seems sensible.
The text was updated successfully, but these errors were encountered: