I wonder if there is a way to distinguish whether an ITensor contains real or complex elements in compiling. I found that I often get a problem of whether to use elt or eltC. For example if I make a function to print the value of a zero-dimension tensor, I will need to use either one of them
void printTensor (ITensor T)
{
cout << elt(T) << endl;
// cout << eltC(T) << endl;
}
and will get an compiling error if I use the wrong one. If would be useful if the type (real or complex) can be automatically determined. I am thinking about something like
void printTensor (ITensor T)
{
constexpr bool is_real = T.something();
if constexpr (is_real)
cout << elt(T) << endl;
else
cout << eltC(T) << endl;
}
Do you think this is possible?