From f0ef0965c45167a7dd50ea11fd6b42fb63042d45 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 11 Feb 2019 10:51:23 -0800 Subject: [PATCH] AnyScalar doc --- src/misc/pv/anyscalar.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/misc/pv/anyscalar.h b/src/misc/pv/anyscalar.h index 0410b24..2efccae 100644 --- a/src/misc/pv/anyscalar.h +++ b/src/misc/pv/anyscalar.h @@ -180,10 +180,11 @@ public: /** Return typed reference to wrapped value. Non-const reference allows value modification * + * @throws bad_cast when the requested type does not match the stored type @code AnyScalar v(42); - v.ref() = 42; - assert(v.ref() = 43); + v.ref() = 43; + assert(v.ref() == 43); @endcode */ template @@ -201,9 +202,10 @@ public: /** Return typed reference to wrapped value. Const reference does not allow modification. * + * @throws bad_cast when the requested type does not match the stored type @code - AnyScalar v(42); - assert(v.ref() = 42); + const AnyScalar v(42); + assert(v.ref() == 42); @endcode */ template @@ -219,7 +221,10 @@ public: return reinterpret_cast::type&>(_wrap.blob); } - /** copy out wrapped value, with a value conversion. */ + /** copy out wrapped value, with a value conversion. + * + * @throws bad_cast when empty()==true + */ template inline T as() const {