From 7b60ff66b08b2c4e7349623f85c8bbed05e3abc2 Mon Sep 17 00:00:00 2001 From: wmtan Date: Wed, 23 Sep 2015 21:56:38 +0200 Subject: [PATCH] Changes suggested by Chris Jones --- DataFormats/Common/test/testOwnVector.cc | 2 +- FWCore/Utilities/interface/OffsetToBase.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DataFormats/Common/test/testOwnVector.cc b/DataFormats/Common/test/testOwnVector.cc index c82c538386444..788bcf84e81b3 100644 --- a/DataFormats/Common/test/testOwnVector.cc +++ b/DataFormats/Common/test/testOwnVector.cc @@ -1,8 +1,8 @@ #include "cppunit/extensions/HelperMacros.h" #include +#include #include #include -#include #include "DataFormats/Common/interface/OwnVector.h" #include "DataFormats/Common/interface/Ptr.h" diff --git a/FWCore/Utilities/interface/OffsetToBase.h b/FWCore/Utilities/interface/OffsetToBase.h index 84ef578c5b265..8b5c225acbd59 100644 --- a/FWCore/Utilities/interface/OffsetToBase.h +++ b/FWCore/Utilities/interface/OffsetToBase.h @@ -10,16 +10,17 @@ * A specialization would look something like this * (in YourClass.h" * - * #include "FWCore/Utilities/interface/OffsetToBase.h + * #include "FWCore/Utilities/interface/OffsetToBase.h" * namespace edm { * template<> * class OffsetToBase { * public OffsetToBase() {} * size_t offsetToBase(std::type_info const& baseTypeInfo) const { - * YourClass object; - * void const* objectPtr = &object; + * int const dummy = 0; + * YourClass const* object = reinterpret_cast(&dummy); + * void const* objectPtr = object; * if(baseTypeInfo == typeid(BaseClass1)) { - * BaseClass1 const* base = &object; + * BaseClass1 const* base = object; * void const* basePtr = base; * return static_cast(basePtr) - static_cast(objectPtr); * }