Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update utils.h to include <limits> #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

APN-Pucky
Copy link

GNU 11.3.1 complains about missing include. This PR fixes it.

 $ make -j1
[  4%] Building CXX object CMakeFiles/cPMML.dir/src/api/exceptions.cc.o
[  9%] Building CXX object CMakeFiles/cPMML.dir/src/api/model.cc.o
In file included from /home/apn/git/cPMML/src/core/closure.h:12,
                 from /home/apn/git/cPMML/src/core/datafield.h:14,
                 from /home/apn/git/cPMML/src/core/datadictionary.h:14,
                 from /home/apn/git/cPMML/src/core/internal_evaluator.h:13,
                 from /home/apn/git/cPMML/src/api/model.cc:8:
/home/apn/git/cPMML/src/utils/utils.h: In function ‘double double_min()’:
/home/apn/git/cPMML/src/utils/utils.h:203:42: error: ‘numeric_limits’ is not a member of ‘std’
  203 | inline double double_min() { return std::numeric_limits<double>::min(); }
      |                                          ^~~~~~~~~~~~~~
/home/apn/git/cPMML/src/utils/utils.h:203:57: error: expected primary-expression before ‘double’
  203 | inline double double_min() { return std::numeric_limits<double>::min(); }
      |                                                         ^~~~~~
/home/apn/git/cPMML/src/utils/utils.h:203:57: error: expected ‘;’ before ‘double’
  203 | inline double double_min() { return std::numeric_limits<double>::min(); }
      |                                                         ^~~~~~
      |                                                         ;
/home/apn/git/cPMML/src/utils/utils.h:203:63: error: expected unqualified-id before ‘>’ token
  203 | inline double double_min() { return std::numeric_limits<double>::min(); }
      |                                                               ^
/home/apn/git/cPMML/src/utils/utils.h: In function ‘std::string format_num(const T&)’:
/home/apn/git/cPMML/src/utils/utils.h:271:29: error: ‘numeric_limits’ is not a member of ‘std’
  271 |   sstr_value.precision(std::numeric_limits<T>::max_digits10);
      |                             ^~~~~~~~~~~~~~
/home/apn/git/cPMML/src/utils/utils.h:271:45: error: expected primary-expression before ‘>’ token
  271 |   sstr_value.precision(std::numeric_limits<T>::max_digits10);
      |                                             ^
/home/apn/git/cPMML/src/utils/utils.h:271:48: error: ‘::max_digits10’ has not been declared
  271 |   sstr_value.precision(std::numeric_limits<T>::max_digits10);
      |                                                ^~~~~~~~~~~~
/home/apn/git/cPMML/src/utils/utils.h: In function ‘std::string format_int(const int&)’:
/home/apn/git/cPMML/src/utils/utils.h:293:29: error: ‘numeric_limits’ is not a member of ‘std’
  293 |   sstr_value.precision(std::numeric_limits<int>::max_digits10);
      |                             ^~~~~~~~~~~~~~
/home/apn/git/cPMML/src/utils/utils.h:293:44: error: expected primary-expression before ‘int’
  293 |   sstr_value.precision(std::numeric_limits<int>::max_digits10);
      |                                            ^~~
^Cmake[2]: *** [CMakeFiles/cPMML.dir/build.make:90: CMakeFiles/cPMML.dir/src/api/model.cc.o] Interrupt
make[1]: *** [CMakeFiles/Makefile2:151: CMakeFiles/cPMML.dir/all] Interrupt
make: *** [Makefile:146: all] Interrupt

@aCuria
Copy link

aCuria commented Apr 25, 2023

Can we get this into master

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

Successfully merging this pull request may close these issues.

2 participants