5 ! Contributed by Damian Rouson
7 module ref_counter_implementation
11 generic
:: assignment(=) => assign
14 subroutine assign (lhs
, rhs
)
15 class (ref_counter
), intent(inout
) :: lhs
16 class (ref_counter
), intent(in
) :: rhs
19 module foo_parent_implementation
20 use ref_counter_implementation
,only
: ref_counter
22 type(ref_counter
) :: counter
25 type(foo_parent
) function new_foo_parent()
28 module foo_implementation
29 use foo_parent_implementation
,only
: foo_parent
,new_foo_parent
30 type, extends(foo_parent
) :: foo
33 type(foo
) function new_foo()
34 new_foo
%foo_parent
= new_foo_parent()