Explorar el Código

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 hace 2 años
padre
commit
4605b1d3e1
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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