本文为摘录,原文为: https://www.cppstories.com/2017/01/cpp17features/
1 Language Features
1.1 New auto rules for direct-list-initialization
1.2 static_assert with no message
static_assert()
可以不用再写 message 了, 类似 C assert
1.3 typename in a template template parameter
模板中以前只能用 class
来声明类型,现在可以用 typename
了
template <template <typename...> typename Container>
// used to be invalid ^^^^^^^^
struct foo;
foo<std::vector> my_foo;
1.4 Nested namespace definition
Allows to write:
namespace A::B::C {
// ...
}
Rather than:
namespace A {
namespace B {
namespace C {
// ...
}
}
}