As for the comment of @rouson : I absolutely agree, one should use allocatables, wherever it is feasible. Unfortunately, if you want to create an efficient list, allocatables are sometimes not enough. Think about a list containing large objects (arrays, other containers, etc.). You may wish the list to be able to deliver a pointer to a given list element, so that you can process the elements content without having to make a copy of it. As discussed in Enforcing target attribute for actual argument in TBP calls, it is basically impossible to obtain a reliable pointer to the component of a derived type, if it has no pointer components…
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Finalization/Copy in intrinsic polymorphic assignment | 3 | 774 | November 29, 2021 | |
Defined assignment for polymorphic variables | 8 | 1129 | March 14, 2022 | |
Questions about derived type intrinsic assignment
|
20 | 277 | July 15, 2024 | |
Double finalization on assignment | 4 | 498 | April 7, 2022 | |
Intrinsic assigment of derived types containing components with user defined assignment | 3 | 681 | January 14, 2022 |