My textbook derives the equivalence of Hamilton principle to d'Alembert's principle as such:
\begin{align} 0&=\int_{t_1}^{t_2}\left(\sum_i(m_i\ddot{\vec{r}}-\vec K_i)\cdot\delta\vec r_i\right)dt=\\ &\ \ \vdots\\ =\int_{t_1}^{t_2}\delta(T-V)dt&=\delta\int_{t_1}^{t_2}(T-V)dt, \end{align} where the virtual displacements $\delta\vec r_i$ are differential functions of time.
The last equation is justified by saying:
".. we have exploited that for virtual displacements the times are not varied at all ($\delta t=0$) so that we could draw, for instance, the variation $\delta$ to the front of the integral."
Now I just can't figure out how "for virtual displacements the times are not varied at all" implies that we could draw $\delta$ to the front. At first I would imagine it means that virtual displacements are not dependent on time, therefore $\delta(T-V)$ is not influenced by the $dt$ in the integral and you can do whatever you want with $\delta(T-V)$. But the book states in the beginning of the derivation that
"the virtual displacements $\delta\vec r_i$ are differential functions of time",
and $T$ and $V$ are functions of $\delta\vec r_i$. So that contradicts my hypothesis.