Should we avoid assignment of derived types in robust programs?

So the “lesson” to be learned here (as per my hints in earlier posts across a couple of threads on this topic) is

  • Avoid implementing defined assignment in a “container” derived type, rely instead on intrinsic assignment semantics as provided in the standard, and
  • Should the “container” derived type need to have “components” for which the intrinsic assignment might be seen as inadequate e.g., those with POINTER attribute, then wrap such components themselves in a derived type that has a suitably defined assignment.
3 Likes