etmc / tmLQCD

tmLQCD is a freely available software suite providing a set of tools to be used in lattice QCD simulations. This is mainly a HMC implementation (including PHMC and RHMC) for Wilson, Wilson Clover and Wilson twisted mass fermions and inverter for different versions of the Dirac operator. The code is fully parallelised and ships with optimisations for various modern architectures, such as commodity PC clusters and the Blue Gene family.
http://www.itkp.uni-bonn.de/~urbach/software.html
GNU General Public License v3.0
32 stars 47 forks source link

rename operator to something palatable in C++ #381

Open kostrzewa opened 7 years ago

kostrzewa commented 7 years ago

Right now, operator.h cannot be included in any code compiled by a C++ compiler because we are using the keyword operator to name a struct. I would like to rename this at some point. For now, I will work around it by moving the definition of the operator types out of operator.h into an operator_types.h, so that I can get on with writing the test code for qphix.

kostrzewa commented 7 years ago

The renaming will, of course, break dependent codes..

martin-ueding commented 7 years ago

What about some legacy typedef? Let's say it gets renamed to Operator. Then one could do this:

#ifndef __cplusplus
typedef Operator operator;
#endif

Dependent code could still use the name operator, tmLQCD internally could use Operator and be used with a C++ compiler.