- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everybody,
I am wondering if there is any way to implement this kind of thing:
[fortran] type,abstract :: c_father_b ... end type c_father_b !------------------------------- type, extends(c_father_b) :: c_child_b ... end type c_child_b !------------------------------- type,abstract :: c_father_a class(c_father_b), pointer :: ptr_to_b end type c_father_a !------------------------------- type, extends(c_father_a) :: c_child_a type(c_child_b), pointer :: ptr_to_b end type c_child_a[/fortran]
The reason is that I have a main abstrac class (A) which have a pointer to another abstract class(B). However, in SOME of the children of A will ALWAYS have this pointer to a specific children of B. The way I have it implemented now is using the pointer for c_father_a and having type select all around the code, which we must agree, its not beautiful at all. Is there any workaround for that and/or a plan to the implementation of this feature?
Thanks in advance!
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page