@@ -81,11 +81,7 @@ DofObject & DofObject::operator= (const DofObject & dof_obj)
8181
8282#ifdef LIBMESH_ENABLE_AMR
8383 this -> clear_old_dof_object ();
84-
85- // Note: we can't use std::make_unique here because the DofObject
86- // copy constructor is private, and std::make_unique effectively
87- // calls "placement new" which requires a public constructor.
88- this -> old_dof_object = std ::unique_ptr < DofObject > (new DofObject (* dof_obj .old_dof_object ));
84+ this -> old_dof_object = this -> construct (dof_obj .old_dof_object .get ());
8985#endif
9086
9187 _id = dof_obj ._id ;
@@ -142,10 +138,9 @@ void DofObject::set_old_dof_object ()
142138
143139 libmesh_assert (!this -> old_dof_object );
144140
145- // Note: we can't use std::make_unique here because the DofObject
146- // copy constructor is private, and std::make_unique effectively
147- // calls "placement new" which requires a public constructor.
148- this -> old_dof_object = std ::unique_ptr < DofObject > (new DofObject (* this ));
141+ // Make a new DofObject, assign a copy of \p this.
142+ // Make sure the copy ctor for DofObject works!!
143+ this -> old_dof_object = this -> construct (this );
149144}
150145
151146#endif
@@ -634,7 +629,7 @@ void DofObject::unpack_indexing(std::vector<largest_id_type>::const_iterator beg
634629#ifdef LIBMESH_ENABLE_AMR
635630 if (has_old_dof_object )
636631 {
637- this -> old_dof_object = std :: unique_ptr < DofObject > ( new DofObject () );
632+ this -> old_dof_object = this -> construct ( );
638633 this -> old_dof_object -> unpack_indexing (begin + size );
639634 }
640635#endif
0 commit comments