summaryrefslogtreecommitdiff
path: root/docs/common/lib_common/Conversion.txt
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2009-03-31 15:58:19 +0200
committerReinhard Tartler <siretart@tauware.de>2009-03-31 15:58:19 +0200
commit25db897553a0db0f912602b375029e724f51556e (patch)
tree613c8c23e22481e31a4d2f474e022ad87728da24 /docs/common/lib_common/Conversion.txt
parent2787035d98661881477d696403ca2a78b49322d5 (diff)
Import upstream version 0.11~rc2+r2072
Diffstat (limited to 'docs/common/lib_common/Conversion.txt')
-rw-r--r--docs/common/lib_common/Conversion.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/common/lib_common/Conversion.txt b/docs/common/lib_common/Conversion.txt
new file mode 100644
index 00000000..62d1967a
--- /dev/null
+++ b/docs/common/lib_common/Conversion.txt
@@ -0,0 +1,14 @@
+TITLE Generic type conversion
+
+Conversion.h provides generic type conversion. Within the BoxConvert namespace, it defines the templated function
+
+ ToType Convert<ToType, FromType>(FromType From)
+
+which converts the data type as expected. In general, from and to types have to be specified explicitly.
+
+Templates rather than overloaded functions are used, firstly to be absolutely explicit about the conversion required, and secondly because overloaded functions can't have differing return types for the same argument type.
+
+The function is specialised for various types, and the generic version uses C++ type conversion.
+
+Exceptions may be thrown if the conversion is not possible. These are all of the ConversionException type.
+