summaryrefslogtreecommitdiff
path: root/docs/C++CASTING
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-07-27 21:31:13 -0400
committerAdam <Adam@anope.org>2010-07-27 21:31:13 -0400
commit4b870cc5f9671201dfad6fa836847cdd40aef519 (patch)
tree34aec3d880a22a8a828e5f5a7917e583cee92023 /docs/C++CASTING
parent66c0e280ee9d4940fe5a477d3e933ba4221e35db (diff)
Added debug_cast which uses dynamic_cast on debug builds, and static_cast on release builds
Diffstat (limited to 'docs/C++CASTING')
-rw-r--r--docs/C++CASTING5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/C++CASTING b/docs/C++CASTING
index 5a121a5d1..bae24a24c 100644
--- a/docs/C++CASTING
+++ b/docs/C++CASTING
@@ -78,6 +78,11 @@ This is safer than C-style casting in that an invalid pointer conversion will
return a NULL pointer, and an invalid reference conversion will throw a
Bad_cast exception.
+Note that in Anope we prefer if Anope::debug_cast is used.
+This uses dynamic_cast (and checks for a NULL pointer return) on debug builds
+and static_cast on release builds, to speed up the program beacuse of dynamic_cast's
+reliance on RTTI.
+
reinterpret_cast
----------------