Detect and use std::is_trivially_copyable<T> where possible.