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 | 1077 | July 20, 2023 | |
Questions about derived type intrinsic assignment
|
20 | 323 | July 15, 2024 | |
Intrinsic assigment of derived types containing components with user defined assignment | 3 | 696 | January 14, 2022 | |
Defined assignment for polymorphic variables | 8 | 1168 | March 14, 2022 | |
Suppressing copy and assignment
|
15 | 519 | October 1, 2024 |