blob: ad91e761a1798adcffff5b7b288082280c8cb74f [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <cstdint>
#include <vector>
namespace forensics {
// Move-only specialization of std::vector that can be used in place of std::vector when
// the data in the underlying buffer is copyable, but copying it is undesirable, e.g. the vector
// holds a large amount of data.
class SizedData : public std::vector<uint8_t> {
// Inherit the constructors of std::vector.
using std::vector<uint8_t>::vector;
// Delete copy constructors.
SizedData(const SizedData& other) = delete;
SizedData& operator=(const SizedData& other) = delete;
// Define move constructors as defaults.
SizedData(SizedData&& other) = default;
SizedData& operator=(SizedData&& other) = default;
} // namespace forensics