narizhny / numeric_safety

c++ comparison between signed and unsigned, types cast with boundary check
Apache License 2.0
0 stars 0 forks source link

template bug #1

Open peterritter opened 7 years ago

peterritter commented 7 years ago

Hi I am just trying to compile a project that works fine in Visual Studio 2017 on Fedora Linux. The g++ version is 7.1.1 The error involves the 'shaddowing' of two template parameters in compare.h. It look like an easy fix if you know hat you are doing. I'm really stressed about my project so i don't have time to experiment wtih this . I would really appreciate a fix. Thanks, Peter

The error is as follows:

./tsapi_dev/Testing/../source/tsa/numeric_safety/compare.h:319:12: error: declaration of template parameter ‘Left’ shadows template parameter template<class Left, class Right, class Type> class Operator> ^~~~~ ../tsapi_dev/Testing/../source/tsa/numeric_safety/compare.h:317:11: note: template parameter ‘Left’ declared here template<class Left, ^~~~~ ../tsapi_dev/Testing/../source/tsa/numeric_safety/compare.h:319:24: error: declaration of template parameter ‘Right’ shadows template parameter template<class Left, class Right, class Type> class Operator> ^~~~~ ../tsapi_dev/Testing/../source/tsa/numeric_safety/compare.h:318:3: note: template parameter ‘Right’ declared here class Right, ^~~~~

narizhny commented 7 years ago

Hi! Could you add code fragment?

narizhny commented 7 years ago

oh. yes i will fix it in a few minutes

narizhny commented 7 years ago

please, check it in visual studio and g++ unfortunately, I don't have them both right now