Parameterization and “function template partial specialization is not allowed”
This is a continuation of What is the function parameter equivalent of constexpr? In the original question, we are trying to speed-up some code that performs shifts and rotates under Clang and VC++. Clang and VC++ does not optimize the code well because it treats the shift/rotate amount as variable (i.e., not constexpr ). When I attempt to parameterize the shift amount and the word size, it results in: $ g++ -std=c++11 -march=native test.cxx -o test.exe test.cxx:13:10: error: function template partial specialization is not allowed uint32_t LeftRotate<uint32_t, unsigned int>(uint32_t v) ^ ~~~~~