Skip to content

Nouvelles versions cpp école primaire #10

@ghost

Description

struct times_looper {

    unsigned long long n;

    template<typename F>
    void operator()(F fun) {
        for(int i = 0; i<n; ++i) {
            fun();
        }
    }

};

times_looper operator "" _times(unsigned long long n) {
    return times_looper{n};
}

int main(int argc, char** argv) {
    100_times( []() { std::cout << "Je ne dois pas jeter d'avion en papier en classe" << std::endl; } ) ;
    return 0;
}

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