Просмотр исходного кода

Style note for explicit constructors. (#3457)

This stems from an [old
discussion](https://discord.com/channels/655572317891461132/821113559755784242/1070759074112741447),
I think this is the resolution that never got added here.
Jon Ross-Perkins 2 лет назад
Родитель
Сommit
4605b1d3e1
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      docs/project/cpp_style_guide.md

+ 2 - 0
docs/project/cpp_style_guide.md

@@ -135,6 +135,8 @@ these.
     -   Use `{}` initialization without the `=` only if the above options don't
         compile.
     -   Never mix `{}` initialization and `auto`.
+-   Always mark constructors `explicit` unless there's a specific reason to
+    support implicit or `{}` initialization.
 -   Always use braces for conditional, `switch`, and loop statements, even when
     the body is a single statement.
     -   Within a `switch` statement, use braces after a `case` label when