/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This specialization is private to nsCOMArray. // It exists solely to automatically zero-out newly created array elements. template <> class nsTArrayElementTraits<nsISupports*> { typedef nsISupports* E;
public: // Zero out the value staticinlinevoid Construct(E* aE) { new (mozilla::KnownNotNull, static_cast<void*>(aE)) E();
} // Invoke the copy-constructor in place. template <class A> staticinlinevoid Construct(E* aE, const A& aArg) { new (mozilla::KnownNotNull, static_cast<void*>(aE)) E(aArg);
} // Construct in place. template <class... Args> staticinlinevoid Emplace(E* aE, Args&&... aArgs) { new (mozilla::KnownNotNull, static_cast<void*>(aE))
E(std::forward<Args>(aArgs)...);
} // Invoke the destructor in place. staticinlinevoid Destruct(E* aE) { aE->~E(); }
};
// implementations of non-trivial methods in nsCOMArray_base
nsCOMArray_base::nsCOMArray_base(const nsCOMArray_base& aOther) { // make sure we do only one allocation
mArray.SetCapacity(aOther.Count());
AppendObjects(aOther);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.