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

Simple scan of multiple values fails after one string value #134

Open
RazielXYZ opened this issue Nov 18, 2024 · 0 comments
Open

Simple scan of multiple values fails after one string value #134

RazielXYZ opened this issue Nov 18, 2024 · 0 comments

Comments

@RazielXYZ
Copy link

RazielXYZ commented Nov 18, 2024

scnlib 4.0.1
Take for example this simple test code:

#include <iostream>
#include <string>
#include <scn/scan.h>

int main()
{
    auto scanResult = scn::scan<std::string, std::string>(
        "TEST.32.bar", "TEST.{}.{}");

    if (!scanResult) {
        std::cout << scanResult.error().code() << " " << scanResult.error().msg() << "\n";
    }
}

This fails with code 3, Unexpected end of source.
Changing the first argument to int makes it succeed, however adding any more arguments after the std::string goes back to failing. I've also seen it fail with "Argument list not exhausted" in some cases.
Is reading more than one string out of an input, or anything else after reading a string, given well-defined separators, not supported in this manner?

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

No branches or pull requests

1 participant