]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/weakrefdynamic.tex
split wxSizer::Fit() into ComputeFittingWindow/ClientSize() that only does computatio...
[wxWidgets.git] / docs / latex / wx / weakrefdynamic.tex
CommitLineData
cc6ceca7
VZ
1\section{\class{wxWeakRefDynamic<T>}}\label{wxweakrefdynamic}
2
3wxWeakRefDynamic<T> is a template class for weak references that is used in
4the same way as wxWeakRef<T>. The only difference is that wxWeakRefDynamic
5defaults to using \texttt{dynamic\_cast<>} for establishing the object
6reference (while wxWeakRef defaults to \texttt{static\_cast<>}).
7
8So, wxWeakRef will detect a type mismatch during compile time and will
9have a little better run-time performance. The role of wxWeakRefDynamic
10is to handle objects which derived type one does not know.
11
12\textbf{Note:} wxWeakRef<T> selects an implementation based on the static type
13of T. If T does not have wxTrackable statically, it defaults to to a mixed-
14mode operation, where it uses \texttt{dynamic\_cast<>} as the last measure (if
15available from the compiler and enabled when building wxWidgets).
16
17For general cases, wxWeakRef<T> is the better choice.
18
19For API documentation, see: \helpref{wxWeakRef}{wxweakref}
20