Here is an example of a code that works perfectly:
#include
#include
template< class D, template< class D, class A >
From the C++ standard (4.10 Pointer conversions [conv.ptr])
1 A null pointer constant is an integral constant expression (5.19) prvalue of integer type that evaluates to zero or a prvalue of type std::nullptr_t. A null pointer constant can be converted to a pointer type; the result is the null pointer value of that type and is distinguishable from every other value of object pointer or function pointer type. Such a conversion is called a null pointer conversion.
In your first exemple your two nullptr have already been converted before template argument deduction. So there is no problem you have the same type twice.
In the second one, there is a std::vector
and a std::nullptr_t
and that does not match. You have to do the conversion yourself: static_cast
.