Skip to content

败犬日报 2025-04-08

1. 同名变量 shadow

cpp
int x;
{
    int x;
}

shadow 容易出 bug。(且不能像 rust 那样初始化使用被 shadow 的变量,很鸡肋)

可以用编译选项 -Wshadow 警告这种行为。

这个是兼容 C 导致的。

Why do programming languages allow shadowing/hiding of variables and functions?

What are the pros and cons of allowing variable shadowing in the general case?

2. 群友使用的 vscode 主题

  • 自带的 dark modern / dark+
  • dracula official
  • atom one light
  • hyper term theme
  • one dark
  • one monokai
  • doki theme
  • vim dark hard
  • solarized light

3. copilot 这种代码补全有时候不出来怎么办

一般按个空格再删掉空格。(或者 Alt + \

4. 对象存储科普(视频)

https://fs.neo.org/presentation/

5. 推荐公众号:深度 Linux

6. std::visit 能不能传入非 variant

不能,要自己搓一个 visit。