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