Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29277 Discussions

PROTECTED attribute in derived types?

jond
Novice
795 Views
Fortran 2003 allows some components of a drived type to be PUBLIC and others PRIVATE (although, I believe, this feature hasn't been implemented in IVF yet). Is it also the case for PROTECTED attribute? Can one declare some derived-type components PRIVATE (or PUBLIC) and the rest PROTECTED?

Thanks,
Jon
0 Kudos
1 Reply
ArturGuzik
Valued Contributor I
795 Views
Quoting - jond
Can one declare some derived-type components PRIVATE (or PUBLIC) and the rest PROTECTED?

Jon,

I might be (very) wrong but as far as I know the standard reads something along the lines:

The PROTECTED attribute imposes limitations on the usage of module entities. If an object has the PROTECTED attribute, all of its subobjects have the PROTECTED attribute.

So you can't make derived-type component protected.

A.
0 Kudos
Reply