[J3] [EXTERNAL] Elemental type-bound functions not useful
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Mon Mar 29 18:25:17 UTC 2021
Why? The restriction on elemental is that the return type not be polymorphic. There is no restriction that the passed-object dummy be non-polymorphic.
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of j3 <j3 at mailman.j3-fortran.org>
Reply-To: j3 <j3 at mailman.j3-fortran.org>
Date: Monday, March 29, 2021 at 2:18 PM
To: j3 <j3 at mailman.j3-fortran.org>
Cc: Van Snyder <van.snyder at sbcglobal.net>
Subject: Re: [J3] [EXTERNAL] Elemental type-bound functions not useful
On Mon, 2021-03-29 at 12:59 +0000, Clune, Thomas L. (GSFC-6101) via J3 wrote:
I meant to add that the use case you are describing is essentially the poster child for templates vs OO. When the return type varies with the input type, templates are a very natural fit, and trying to force OO is tricky at best.
This doesn't solve the problem unless type-bound functions are allowed not to have polymorphic passed-object dummy arguments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210329/44a6d12c/attachment.htm>
More information about the J3
mailing list