(j3.2006) defining a type with no components
Bill Long
longb
Thu Apr 17 08:31:19 EDT 2014
On Apr 16, 2014, at 6:34 PM, Malcolm Cohen <malcolm at nag-j.co.jp> wrote:
>> Given 10-007r1 and
>>
>> type :: no_comp
>> end type no_comp
>>
>> and then
>>
>> type( no_comp) :: foo
>>
>> is foo defined?
>
> Yes.
Really? I don?t see any initialization. It appears to be just declared, but not defined. Or is the argument that all components that don?t exist are considered to be default initialized, and hence a type with no components automatically has default initialization?
It would seem to me that this causes foo to be defined:
type(no_comp) :: foo = no_comp()
Cheers,
Bill
Bill Long longb at cray.com
Fortran Technical Suport & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101
More information about the J3
mailing list