-4

I'm having some problems with this program I'm making in C++. For what I'm doing here:

{
    GridWorld world;
    string input = "";

    while (input != "q")
    {
        thread render(&GridWorld::Render, GridWorld());
        render.join();

        input = world.GetInput();

        thread thread_update(&GridWorld::Update, GridWorld());

        thread_update.join();

    }

    cout << "Thank you for playing\n";
}

I get these errors

It used to work before, but now it is not anymore.

Can someone please help

1 Answers1

0

Have you tried using lambda expressions?

...
thread render([]() { GridWorld().Render(); });
...
thread thread_update([]() { GridWorld().Update(); });
...

Or maybe

...
thread render([&world]() { world.Render(); });
...
thread thread_update([&world]() { world.Update(); });
...
Deon
  • 1
  • 1