-
3 votesanswersviews
根据实例化的要求,期望不同的类型
我预计以下会形成NDR,但似乎不是:-( #include <type_traits> template <typename T, typename Enabler = void> struct is_complete : std::false_type {}; template <typename T> struct is_complete<T, s... -
10 votesanswersviews
如果已经隐式实例化了特化,则会隐式实例化它吗?
Headers 中的问题很清楚 . 更具体地说,请考虑以下示例: #include <type_traits> template <typename T> struct is_complete_helper { template <typename U> static auto test(U*) -> std::integral_con... -
5 votesanswersviews
从非实例化的上下文中引用特定的模板特化:实例化与否?
请考虑以下示例 template <typename A> struct S { A a; void foo() {} }; template <typename T> void bar() { S<void> *p = 0; } template <typename T> void baz() { S<void>...