irandom with unique_ptr