I'm implementing the Discrete Fourier Transform for a school assignment, and I've created a DFT
class which constructs the transformation matrix. For some reason, when I instantiate a DFT
object in main()
everything works fine, but the matrix isn't constructed properly if I use the unnamed namespace.
Works:
int main()
{
DFT matrix(size);
...
matrix.Transform(data);
...
}
Doesn't work:
namespace
{
DFT matrix(size);
}
int main()
{
...
matrix.Transform(data);
...
}
Compiler bug, or am I misremembering how the unnamed namespace works?