gpt4 book ai didi

c++ - 避免条件代码编译

转载 作者:行者123 更新时间:2023-11-27 23:12:30 26 4
gpt4 key购买 nike

<分区>

Google C++ 风格指南(http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Preprocessor_Macros)说:

“与其使用宏来有条件地编译代码……好吧,根本不要那样做”

为什么像这样的函数这么糟糕

void foo()
{
// some code

#ifdef SOME_FUNCTIONALITY
// code
#endif

// more code
}

?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com