icecream-cpp icon indicating copy to clipboard operation
icecream-cpp copied to clipboard

cannot display char as integer

Open logerrors opened this issue 2 years ago • 0 comments

CleanShot 2022-09-03 at 10 51 31@2x

#include <algorithm>
#include <numeric> 

#include "icecream.hpp"

using namespace std;

#define DETECT_TYPE(x)                        \
    do                                        \
    {                                         \
        IC(sizeof(x));                        \
        IC_("d", std::numeric_limits<x>::max());    \
        IC_("d", std::numeric_limits<x>::min());    \
        IC_("d", std::numeric_limits<x>::lowest()); \
    } while (0)


int main(int argc, char **argv)
{
    DETECT_TYPE(char);
    DETECT_TYPE(unsigned char);
    return 0;
}

expect: it should display max: 128, min: -127, lowest: -127 gcc 11.2 linux

logerrors avatar Sep 03 '22 02:09 logerrors