Skip to content

Conversation

@grybouilli
Copy link

@grybouilli grybouilli commented Jul 21, 2025

Fix description

Add header to fix "error: incomplete type ‘std::numeric_limits’ used in nested name specifier"

Reproduce bug

To reproduce, use the code from README.md :

#include <qrcode/qrcode.h>
#include <iostream>

int main()
{
    using namespace qrcode;
    using namespace std::literals;
    
    auto symbol = qr::make_symbol("Hello World!"sv, qr::error_correction::level_L).value();

    auto count = 0;
    for (auto i : views::horizontal(symbol))
    {
        std::cout << (i ? '#' : ' ');
        ++count;
        if (count % width(symbol) == 0)
            std::cout << '\n';
    }
}

Compile with (assuming code in file test.cpp in repo folder):

g++ test.cpp -std=c++20 -I./include

with g++ 13.3.0 gives:

include/qrcode/code/byte_view.h: In function ‘constexpr auto qrcode::code::detail::bits_per_byte()’:
include/qrcode/code/byte_view.h:39:51: error: incomplete type ‘std::numeric_limits<unsigned char>’ used in nested name specifier
   39 |         return std::numeric_limits<std::uint8_t>::digits;
      | 

…ed in nested name specifier" due to missing header
@grybouilli grybouilli changed the title Fix : "error: incomplete type ‘std::numeric_limits<unsigned char>’ Fix : "error: incomplete type ‘std::numeric_limits<unsigned char>’ " Jul 21, 2025
@ixik-melissa
Copy link
Owner

Thank you very much for pointing that out.
Fixed in PR #13.

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