Questions tagged «shadowing»

2
Lambda捕获和具有相同名称的参数-谁遮蔽了另一个?(c声与gcc)
auto foo = "You're using g++!"; auto compiler_detector = [foo](auto foo) { std::puts(foo); }; compiler_detector("You're using clang++!"); clang ++ 3.6.0及更高版本打印出“您正在使用clang ++!” 并警告捕获 foo未使用。 g ++ 4.9.0及更高版本打印出“您正在使用g ++!” 并警告未使用该参数 foo。 哪种编译器更准确地遵循C ++标准? 魔盒示例
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.