1>butteraugli.h(137): error C2219: syntax error: type qualifier must be after '*' 1>butteraugli.h(258): error C2219: syntax error: type qualifier must be after '*' 1>butteraugli.h(258): note: see reference to alias template instantiation 'ConstRestrict<ComponentType*>' being compiled 1>butteraugli.h(302): note: see reference to class template instantiation 'butteraugli::Image<ComponentType>' being compiled
The compilation error is:
1>butteraugli.h(137): error C2219: syntax error: type qualifier must be after '*' 1>butteraugli.h(258): error C2219: syntax error: type qualifier must be after '*' 1>butteraugli.h(258): note: see reference to alias template instantiation 'ConstRestrict<ComponentType*>' being compiled 1>butteraugli.h(302): note: see reference to class template instantiation 'butteraugli::Image<ComponentType>' being compiled
It looks like somebody has already done some research on this issue here: https://stackoverflow.com/questions/42869470/should-msvc-reject-an-templated-using-without-instantiation . From what they're saying, it seems like it's a genuine flaw in the code but I haven't had time to dig into the C++ spec.
A simple workaround for this glitch is changing the alias declaration to something along the lines of:
using ConstRestrict = T const;