Visual Studio 2017 (version 17.10.4) has a known issue where template error messages are not displayed correctly. This issue is being tracked by Microsoft and has been fixed in later versions of Visual Studio.
To work around this issue in Visual Studio 2017, try the following:
- Enable "Diagnostic mode" in the Output window:
- Go to Tools > Options > Projects and Solutions > Build and Run.
- Under "MSBuild project build output verbosity", select "Diagnostic".
- Increase the "Template Depth" limit:
- Go to Tools > Options > Text Editor > C/C++ > Advanced.
- Under "Template Depth", increase the value (e.g., to 1000).
- Use the "/Wall" compiler option to show all warnings and errors:
- Go to Project > Properties > Configuration Properties > C/C++ > Command Line.
- Add "/Wall" to the "Additional Options" field.
If these workarounds don't help, consider upgrading to a later version of Visual Studio, such as Visual Studio 2019 or Visual Studio 2022, which have improved template error reporting.