Why does MatcherBase
class in gtest-matchers.h from googletest
define a VTable
, and what is its purpose? I speculate that it implements a mechanism similar to a virtual function table, but why not just use virtual functions directly?
https://github.com/google/googletest/blob/main/googletest/include/gtest/gtest-matchers.h
I tried to searching and ask some LLMs, but I didn’t get good answers. I’d like to get professional answers from C++ experts. Thank you!
New contributor
Breeze Werp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.