diff --git a/book/en-us/02-usability.md b/book/en-us/02-usability.md index 935fce6..f289239 100644 --- a/book/en-us/02-usability.md +++ b/book/en-us/02-usability.md @@ -312,7 +312,8 @@ be used as a formal parameter of a normal function, for example: ```Cpp public: void foo(std::initializer_list list) { - for (std::initializer_list::iterator it = list.begin(); it != list.end(); ++it) vec.push_back(*it); + for (std::initializer_list::iterator it = list.begin(); + it != list.end(); ++it) vec.push_back(*it); } magicFoo.foo({6,7,8,9}); @@ -1046,7 +1047,9 @@ And we want to get the value of the enumeration value, we will have to explicitl ```cpp #include template -std::ostream& operator<<(typename std::enable_if::value, std::ostream>::type& stream, const T& e) +std::ostream& operator<<( + typename std::enable_if::value, + std::ostream>::type& stream, const T& e) { return stream << static_cast::type>(e); } diff --git a/book/zh-cn/02-usability.md b/book/zh-cn/02-usability.md index 489eea5..18f2d53 100644 --- a/book/zh-cn/02-usability.md +++ b/book/zh-cn/02-usability.md @@ -258,7 +258,8 @@ int main() { ```Cpp public: void foo(std::initializer_list list) { - for (std::initializer_list::iterator it = list.begin(); it != list.end(); ++it) vec.push_back(*it); + for (std::initializer_list::iterator it = list.begin(); + it != list.end(); ++it) vec.push_back(*it); } magicFoo.foo({6,7,8,9}); @@ -964,7 +965,9 @@ if (new_enum::value3 == new_enum::value4) { ```cpp #include template -std::ostream& operator<<(typename std::enable_if::value, std::ostream>::type& stream, const T& e) +std::ostream& operator<<( + typename std::enable_if::value, + std::ostream>::type& stream, const T& e) { return stream << static_cast::type>(e); }