picongpu icon indicating copy to clipboard operation
picongpu copied to clipboard

radiation window function: replace namespaces with functors

Open PrometheusPi opened this issue 10 years ago • 4 comments

Currently, the radiation window functions are selected via namespaces. This should be replaced by functors as suggested by @psychocoderHPC.

PrometheusPi avatar Apr 08 '15 09:04 PrometheusPi

@psychocoderHPC Could you tell me again, why using functors/classes is better than namespaces?

PrometheusPi avatar Jul 25 '19 15:07 PrometheusPi

Because namespaces cannot be derived from and only form a scope of definitions, while a class groups one aspect together for reusing in a different context. We initially used namespaces and free constant variables in input but found many features, e.g. in dependent variables and normalizations are much easier to express when all options are in classes. Also, some constructs such as SFINAE for probing e.g. a member exists are only possible within classes, not namespaces.

ax3l avatar Aug 23 '19 18:08 ax3l

@PrometheusPi @steindev is very unhappy that we use namespaces here!

psychocoderHPC avatar Jan 26 '23 14:01 psychocoderHPC

Thanks for the reminder – if I forget, please reminder me in 8 years again 😜

PrometheusPi avatar Jan 27 '23 14:01 PrometheusPi