Skip to content

Windows stringer.h error while compiling #12

@jcarcamo

Description

@jcarcamo

Hi there,
First of all I want to thank you for this library it's really easy to use and incorporate into C++ projects. I've already tested it in Linux and OSx and it works as described. However in windows I found that when adding the library in a visual studio project (adding the downloaded project folder to the include directories) at compiling time it shows C2589 Errors (12) and C4003 Warnings (6) at lines:

			T imin = std::numeric_limits<T>::min();
			T imax = std::numeric_limits<T>::max();

from DoubleConverter::Convert, part of stringer.h

As usual googling the problem I found the following StackOverflow solution warning C4003 and errors C2589 and C2059 on: x = std::numeric_limits::max()

I opted to include this as a workaround:

#ifdef _MSC_VER
			T imin = (std::numeric_limits<T>::min)();
			T imax = (std::numeric_limits<T>::max)();
#else
			T imin = std::numeric_limits<T>::min();
			T imax = std::numeric_limits<T>::max();
#endif

I know this might not be the most optimal solution, so I thought that creating an issue would be the best thing to do in order to get your feedback and considerations.

Thanks for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions