Adding Howard to the answer (example).
If users were allowed to specialize characteristic types, they could lie (intentionally or by mistake), and the standard library could no longer guarantee that its behavior was correct.
For example, when an object of type std::vector<T> copied, the optimization used by popular implementations calls std::memcpy to copy all the elements, provided that T trivially copied. They can use std::is_trivially_copy_constructible<T> to determine if optimization is safe. If not, the implementation reverts to a safer, but slower method, which iterates over the elements and calls the T copy constructor.
Now, if you specialize std::is_trivially_copy_constructible for T = std::shared_ptr<my_type> as follows:
namespace std { template <> class is_trivially_copy_constructible<std::shared_ptr<my_type>> : std::true_type { }; }
Then copying a std::vector<std::shared_ptr<my_type>> will be disastrous.
This will not be a mistake in implementing the standard library, but rather a writer of specialization. To some extent, the quote provided by the OP says, "It's your fault, not mine."
source share