Skip to content

Not working with local classes? #326

Description

@qqnnhhdmp
{ // In block scope:
  struct Callbacks {
      virtual ~Callbacks() = default;
      virtual auto on_ball_pocketed(nbs::eightball::BallId ball_id_) -> void = 0;
  };

  using namespace fakeit;

  Mock<Callbacks> mock_callbacks;
  When(Method(mock_callbacks, on_ball_pocketed)).Return();

  pool.on_ball_pocketed = [&mock_callbacks](auto &&_1) {
      return mock_callbacks.get().on_ball_pocketed(_1);
  };

  Verify(Method(mock_callbacks, on_ball_pocketed)).Exactly(1);
}

Error: error C3640: “CATCH2_INTERNAL_TEST_22::Callbacks::[thunk]: __cdecl void __cdecl CATCH2_INTERNAL_TEST_22(void)'::2'::Callbacks::`vcall'{8,{flat}}' }'”: 局部类的引用成员函数或虚拟成员函数必须进行定义

Translation of above chinese:

Reference member function or virtual member function of local class must be defined.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions