如何正确地使用现代C ++?

问题描述 投票:0回答:1
我注意到不正确的无操作操作破坏了代码流。我现在发现了一种新的方式。您认为可能有问题吗?

#ifdef DEBUG inline void print_func(std::string_view str){ std::cout << str << std::endl; } #define PRINT_DEBUG print_func #else inline void NOOP(...) {} #define PRINT_DEBUG NOOP // Maybe __noop can be used but it only works in MSVC: #define PRINT_DEBUG __noop #endif

	
c++ visual-studio c++20 msvcrt no-op
1个回答
0
投票
唯一确定的方法是inline组装。


© www.soinside.com 2019 - 2024. All rights reserved.