aboutsummaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-01-21 15:02:18 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-01-21 15:02:18 +0000
commit689e9bd76fd077fd04fafd05286609f00d71b3bd (patch)
treebf9b496f888a5ba031e282cfe31de4f92c0c34a0 /eval
parent1f72b7fba34d1b4445291d974cb2670a6cb65d37 (diff)
Add noexcept to copy/assign, and reorder for better alignment for size.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/eval/typed_cells.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/eval/src/vespa/eval/eval/typed_cells.h b/eval/src/vespa/eval/eval/typed_cells.h
index f49672b8891..bd8bb97ad0a 100644
--- a/eval/src/vespa/eval/eval/typed_cells.h
+++ b/eval/src/vespa/eval/eval/typed_cells.h
@@ -11,16 +11,16 @@ namespace vespalib::eval {
struct TypedCells {
const void *data;
- CellType type;
size_t size:56;
+ CellType type;
- explicit TypedCells(ConstArrayRef<double> cells) : data(cells.begin()), type(CellType::DOUBLE), size(cells.size()) {}
- explicit TypedCells(ConstArrayRef<float> cells) : data(cells.begin()), type(CellType::FLOAT), size(cells.size()) {}
- explicit TypedCells(ConstArrayRef<BFloat16> cells) : data(cells.begin()), type(CellType::BFLOAT16), size(cells.size()) {}
- explicit TypedCells(ConstArrayRef<Int8Float> cells) : data(cells.begin()), type(CellType::INT8), size(cells.size()) {}
+ explicit TypedCells(ConstArrayRef<double> cells) : data(cells.begin()), size(cells.size()), type(CellType::DOUBLE) {}
+ explicit TypedCells(ConstArrayRef<float> cells) : data(cells.begin()), size(cells.size()), type(CellType::FLOAT) {}
+ explicit TypedCells(ConstArrayRef<BFloat16> cells) : data(cells.begin()), size(cells.size()), type(CellType::BFLOAT16) {}
+ explicit TypedCells(ConstArrayRef<Int8Float> cells) : data(cells.begin()), size(cells.size()), type(CellType::INT8) {}
- TypedCells() noexcept : data(nullptr), type(CellType::DOUBLE), size(0) {}
- TypedCells(const void *dp, CellType ct, size_t sz) noexcept : data(dp), type(ct), size(sz) {}
+ TypedCells() noexcept : data(nullptr), size(0), type(CellType::DOUBLE) {}
+ TypedCells(const void *dp, CellType ct, size_t sz) noexcept : data(dp), size(sz), type(ct) {}
template <typename T> bool check_type() const { return vespalib::eval::check_cell_type<T>(type); }
@@ -32,10 +32,10 @@ struct TypedCells {
return ConstArrayRef<T>((const T *)data, size);
}
- TypedCells(TypedCells &&other) = default;
- TypedCells(const TypedCells &other) = default;
- TypedCells & operator= (TypedCells &&other) = default;
- TypedCells & operator= (const TypedCells &other) = default;
+ TypedCells(TypedCells &&other) noexcept = default;
+ TypedCells(const TypedCells &other) noexcept = default;
+ TypedCells & operator= (TypedCells &&other) noexcept = default;
+ TypedCells & operator= (const TypedCells &other) noexcept = default;
};
} // namespace