summaryrefslogtreecommitdiff
path: root/include/vcl/vclptr.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-05-27 11:40:36 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-05-27 11:40:36 +0200
commit9549fb88f0d00c384b291645df45f4af5d6e8a8a (patch)
treed57186911752dbcf07d7d0b6fecd6cbac425da0e /include/vcl/vclptr.hxx
parent668408fa1c69eaf0f0a37f24e2ec8b4a38fe3db7 (diff)
Prevent accidental mis-uses of VclPtr address-of operator
Change-Id: Ie3588d502e9545ea64bf836b2a0bdc0caead2247
Diffstat (limited to 'include/vcl/vclptr.hxx')
-rw-r--r--include/vcl/vclptr.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx
index ad7d1e20d9eb..c1b1fb656926 100644
--- a/include/vcl/vclptr.hxx
+++ b/include/vcl/vclptr.hxx
@@ -223,6 +223,14 @@ public:
{
return (m_rInnerRef > handle.m_rInnerRef);
}
+
+ /** Deleted address-of operator.
+
+ To avoid confusion whether it returns the address of either the
+ pointed-to raw object (for which to use VclPtr::get instead) or the
+ wrapper itself (for which to use std::addressof instead).
+ */
+ void operator &() = delete;
}; // class VclPtr
template<typename T1, typename T2>