是什么原因,为什么GoogleTest对参数计数使用引用?
testing::InitGoogleTest(&argc, argv);
(我的意思是:据我了解,这是一个输入参数,没有任何区别 是否提供了值或地址)
最佳答案
参见 comments .
// Initializes Google Test. This must be called before calling // RUN_ALL_TESTS(). In particular, it parses a command line for the // flags that Google Test recognizes. Whenever a Google Test flag is // seen, it is removed from argv, and *argc is decremented.
关于c++ - GoogleTest 通过引用初始化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34752224/