diff options
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_column_layout.hh')
-rw-r--r-- | source/blender/editors/space_spreadsheet/spreadsheet_column_layout.hh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.hh b/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.hh index cfbf6963a9d..611337df007 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.hh +++ b/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.hh @@ -16,7 +16,7 @@ #pragma once -#include <variant> +#include <optional> #include "spreadsheet_draw.hh" @@ -39,12 +39,15 @@ struct CollectionCellValue { */ class CellValue { public: - /* The implementation just uses a `std::variant` for simplicity. It can be encapsulated better, - * but it's not really worth the complexity for now. */ - using VariantType = - std::variant<std::monostate, int, float, bool, ObjectCellValue, CollectionCellValue>; - - VariantType value; + /* The implementation just uses a bunch of `std::option` for now. Unfortunately, we cannot use + * `std::variant` yet, due to missing compiler support. This type can really be optimized more, + * but it does not really matter too much currently. */ + + std::optional<int> value_int; + std::optional<float> value_float; + std::optional<bool> value_bool; + std::optional<ObjectCellValue> value_object; + std::optional<CollectionCellValue> value_collection; }; /** |