Skip to content

Invalid range expression of type 'database_binder'; no viable 'begin' function available #224

Description

@andriy-byte

the code from README

        for(auto &&row : db << "select age,name,weight from user where age > ? ;" << 18) {
            int age; string name; double weight;
            row >> age >> name >> weight;
            cout << age << ' ' << name << ' ' << weight << endl;
        }
        // or with a tuple
        for(tuple<int, string, double> row : db << "select age,name,weight from user where age > ? ;" << 18) {
            cout << get<0>(row) << ' ' << get<1>(row) << ' ' << get<2>(row) << endl;
        }

I recived the problem

Invalid range expression of type 'database_binder'; no viable 'begin' function available

at : operator in both foreach loops

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions