- GCC 4.4.3
- Clang 3.1
- Intel C++ Compiler 14.0
- PGI Compiler 2015
auto
,decltype
- Most of compilers do support these
- Initializer lists
- Be careful to use
- Bugs in GCC 4.x
- Variadic templates
- Be careful to use
- Bugs in GCC 4.x
- rvalue references
- std::move was not supported in GCC 4.3
extern template
- Defaulted and deleted functions
- Move constructors/assignments cannot be defaulted in GCC 4.4
- Strongly-typed enums
template <typename T>
T r(T x) { return x; }
template <typename F, typename... T>
inline auto f(F&& f, T&&... x) -> decltype(r(f)(x...)) { return f(x...); }
int g(int);
decltype(f(&g, 123)) x;
using
- Fixed in GCC 4.7
template <typename D>
struct A { typedef int x; };
template <typename D>
struct B : A<B<D>> {
using typename A<B<D>>::x;
x f() { return 1; }
};
<type_traits>
- Template aliases
- Inheriting constructors
- Delegating constructors
nullptr
- Emulated by
MGBASE_NULLPTR
- Emulated by
- Alignment support
- Use
MGBASE_ALIGNOF
- Use
- Explicit virtual overrides
- Use
MGBASE_OVERRIDE
- Use
- Template arguments with internal linkage
- DR 1155
- Do not use locally-defined classes as template parameters
- Uniform initialization syntax
- Zero argument
- Always use
{}
- Always use
- One reference
- Use
()
for the old versions of GCC
- Use
- One argument, not reference
- Use
()
if we expect normal constructors - Use
{}
if we expectinitializer_list<>
- Use
- Multiple arguments
- Use
()
if we expect normal constructors - Use
{}
if we expectinitializer_list<>
- Use
- Omitting return type
- Use if the constructed type is aggregate
- Zero argument