The Finite Difference Time Domain (FDTD) Method is used for full-wave electromagnetic (EM) simulations. FDTD is computationally intensive with performance depending critically on architecture-specific optimizations that have become more challenging given the rapidly changing architectures in modern high-performance computing platforms. We examine a templated meta-programming technique to implement the computational kernels in canonical form, without any architecture-specific optimizations, such that data layout and loop order optimizations can be applied through code transformations. These transformations are abstracted behind a simple yet flexible API for the application developer and require no special tools, relying only on a modern optimizing C++ compiler. Optimizations for data layout and loop order are selected at compile-time using C++ typedefs without the need to modify source code implementations of the algorithm.