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 | |
---|---|---|---|---|
Assigning a derived type variable to itself | 22 | 1091 | July 20, 2023 | |
Intrinsic assigment of derived types containing components with user defined assignment | 3 | 709 | January 14, 2022 | |
Defined assignment for polymorphic variables | 8 | 1184 | March 14, 2022 | |
Questions about derived type intrinsic assignment
|
20 | 332 | July 15, 2024 | |
Finalization/Copy in intrinsic polymorphic assignment | 3 | 789 | November 29, 2021 |