Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

VS 2017 does not accept ConstRestrict #28

Open
DominikWitczakAMD opened this issue Jun 26, 2017 · 1 comment
Open

VS 2017 does not accept ConstRestrict #28

DominikWitczakAMD opened this issue Jun 26, 2017 · 1 comment

Comments

@DominikWitczakAMD
Copy link

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;

@JackBoosY
Copy link

Hi @DominikWitczakAMD, it's a MSVC known bug, and you can use using ConstRestrict = T const; instead.

See issue here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants