[Bf-blender-cvs] [880c840c0bc] master: Fix macos compile error
Jacques Lucke
noreply at git.blender.org
Mon Mar 15 12:42:39 CET 2021
Commit: 880c840c0bc5a267c65c7a526883a37908c35060
Author: Jacques Lucke
Date: Mon Mar 15 12:42:20 2021 +0100
Branches: master
https://developer.blender.org/rB880c840c0bc5a267c65c7a526883a37908c35060
Fix macos compile error
`std::get` does not seem to be available. Using `std::get_if` might work instead.
(Found the error on the buildbot.)
===================================================================
M source/blender/editors/space_spreadsheet/spreadsheet_column_layout.cc
===================================================================
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.cc b/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.cc
index c90cf1a2955..4faf0cac2c0 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_column_layout.cc
@@ -114,7 +114,7 @@ class ColumnLayoutDrawer : public SpreadsheetDrawer {
column.get_value(real_index, cell_value);
if (std::holds_alternative<int>(cell_value.value)) {
- const int value = std::get<int>(cell_value.value);
+ const int value = *std::get_if<int>(&cell_value.value);
const std::string value_str = std::to_string(value);
uiDefIconTextBut(params.block,
UI_BTYPE_LABEL,
@@ -133,7 +133,7 @@ class ColumnLayoutDrawer : public SpreadsheetDrawer {
nullptr);
}
else if (std::holds_alternative<float>(cell_value.value)) {
- const float value = std::get<float>(cell_value.value);
+ const float value = *std::get_if<float>(&cell_value.value);
std::stringstream ss;
ss << std::fixed << std::setprecision(3) << value;
const std::string value_str = ss.str();
@@ -154,7 +154,7 @@ class ColumnLayoutDrawer : public SpreadsheetDrawer {
nullptr);
}
else if (std::holds_alternative<bool>(cell_value.value)) {
- const bool value = std::get<bool>(cell_value.value);
+ const bool value = *std::get_if<bool>(&cell_value.value);
const int icon = value ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
uiDefIconTextBut(params.block,
UI_BTYPE_LABEL,
More information about the Bf-blender-cvs
mailing list